post the headers with curl php -


when post reply in forum, use live http header view parameter used post reply. but, headers no parameter. but, there header this:

content-length: 1115 -----------------------------5959623329472 content-disposition: form-data; name="subject"  title of reply -----------------------------5959623329472 content-disposition: form-data; name="message"  content of reply 

how post headers curl ? code don't work

curl_setopt($ch, curlopt_httpheader, array('post /post http/1.1',     'referer: http://*****.n-stars.org/post?t=4221&mode=reply',     'content-disposition: form-data; name="subject"      test lagi kk 2',     'content-disposition: form-data; name="message"      test lagi ya kk 8)' )); 

please me :d

these not headers, if trying make multipart post request, should content of request body. in headers should inform endpoint multipart request , boundary between parts:

// headers curl_setopt($ch, curlopt_httpheader, array(     'referer: http://*****.n-stars.org/post?t=4221&mode=reply',     'content-type: multipart/form-data, boundary=5959623329472',     'content-length: 1115' ));  // body curl_setopt($ch, curlopt_postfields,  '--5959623329472 content-disposition: form-data; name="subject"  test lagi kk 2 --5959623329472 content-disposition: form-data; name="message"  test lagi ya kk 8) --5959623329472--' ); 

more multipart requests: http://www.faqs.org/rfcs/rfc1867.html


Comments

Popular posts from this blog

Winapi c++: DialogBox hangs when breaking a loop -

vb.net - Font adding using PDFsharp -

javascript - jQuery iScroll clickable list elements while retaining scroll? -