php curl content-length,CURL POST 请求 返回 Length Required

壤驷阳波
2023-12-01

3

2015-09-16 03:04:17 +08:00

header ("Content-type: text/html; charset=utf-8");

ini_set ('display_errors','on');

error_reporting (E_ALL );

ini_set ('memory_limit','10M');

$url="http://xin123.cc/bbs/book_list.aspx?action=new&siteid=1000";

$qd_url="http://xin123.cc/signin/Signin.aspx?Action=index&Mod=Signin&siteid=1000";

$cookie = 'sidxin123=6C24EE628EF9AF160_8_68_37964_500100-2-0-0-0-600';

$data="content=月饼&FaceSelect=1.gif&g=签到";

$ch = curl_init ();

curl_setopt ($ch,CURLOPT_URL,$qd_url );

curl_setopt ($ch,CURLOPT_HEADER,true );

curl_setopt ($ch,CURLOPT_POST,true );

curl_setopt ($ch,CURLOPT_POSTFIELDS,$data );

curl_setopt ($ch,CURLOPT_COOKIE,$cookie );

curl_setopt ($ch,CURLOPT_RETURNTRANSFER,false );

curl_exec ($ch );

curl_close ($ch );

以上代码测试得到

HTTP/1.1 200 OK

Cache-Control: no-cache

Pragma: no-cache

Content-Length: 11900

Content-Type: text/html; charset=utf-8

Expires: -1

Server: Microsoft-IIS/8.0

X-AspNet-Version: 2.0.50727

Set-Cookie: ASP.NET_SessionId=wk1vytudkv1azf55vjd5cbnj; path=/; HttpOnly

Set-Cookie: GUID=409df51603005952; expires=Thu, 15-Sep-2016 19:00:59 GMT; path=/

X-Powered-By: ASP.NET

Date: Tue, 15 Sep 2015 19:00:59 GMT

(内容略)

于是问题在哪?

 类似资料: