php - put multipart data with curl with different content types -


i want ask question because php documentation doesn't mention it

how 1 put xml data , binary data together?

$imagecontent = @file_get_contents($imagelocation); $xmldata ="<xml></xml>"; $headers = array("mime-version: 1.0"); curl_setopt($ch, curlopt_customrequest, "put"); curl_setopt($ch, curlopt_httpheader, $headers ); curl_setopt($ch, curlopt_postfields,$data); 

i know if pass $data array, curl automaticly set multipart, how can associate different content types different contentvariables?

$xmldata $imagecontent content-type: application/atom+xml content-type: "jpg" 

i have sample wich done fputs , more inline , uses boundary. don't know if have curl , if how it?

can provide samplecode please?

thanks, richard

i've found answer similar question , can useful you.


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -