Hello Masters,

My curl code is written below, but it results in 411 Length Required.
Note that I tested with
PHP Code:
$hdr[] = "Content-Length: ".$bodyLength."\r\n\r\n"
but that didnt make any difference, thats why I commented that line off.

PHP Code:
$hdr = array();
$hdr[] = "POST /abc/mypage.aspx HTTP/1.1\r\n";
$hdr[] = "Host: mysite.com\r\n";
$hdr[] = "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20100101 Firefox/16.0\r\n";
$hdr[] = "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n";
$hdr[] = "Accept-Language: en-US,en;q=0.5\r\n";
$hdr[] = "Accept-Encoding: gzip, deflate\r\n";
$hdr[] = "Connection: keep-alive\r\n";
$hdr[] = "Referer: https://www.mysite.com/abc/mypage.aspx\r\n";
$hdr[] = "Cookie: ASP.NET_SessionId=$ASPSESS\r\n";
$hdr[] = "Content-Type: multipart/form-data; boundry=".$d.$boundary."\r\n";
//$hdr[] = "Content-Length: ".$bodyLength."\r\n\r\n";

        
$ch curl_init();
curl_setopt($chCURLOPT_POSTTRUE);
curl_setopt($chCURLOPT_POSTFIELDS$body);
curl_setopt($chCURLOPT_URL"https://www.mysite.com/abc/mypage.aspx");  
curl_setopt($chCURLOPT_RETURNTRANSFERTRUE); 
curl_setopt($chCURLOPT_SSL_VERIFYHOST0); 
curl_setopt($chCURLOPT_SSL_VERIFYPEERFALSE);
curl_setopt($chCURLOPT_FOLLOWLOCATIONTRUE); 
curl_setopt($chCURLOPT_HEADERTRUE); 
curl_setopt($chCURLOPT_HTTPHEADER$hdr);
curl_setopt($chCURLOPT_COOKIEFILEdirname(__FILE__) . "/cookies.txt");
curl_setopt($chCURLOPT_COOKIEJARdirname(__FILE__) . "/cookies.txt");   
$data curl_exec($ch);
curl_close($ch); 
Please help
Regards
ZH