要发送的编码:Ozs+Oz4+Oz4+Oz4+O2w8SGVhZDE6aW1nYnRfU2VhcmNoO2ltZ2J0X2Rvd25sb2FkOz4+iI2f2xpLK6SyvRR3knp34fEanZw=
收到的编码:Ozs+Oz4+Oz4+Oz4+O2w8SGVhZDE6aW1nYnRfU2VhcmNoO2ltZ2J0X2Rvd25sb2FkOz4+iI2f2xpLK6SyvRR3knp34fEanZw=
2d602d60这个哪来的啊,把=号过滤掉就没问题了。高手们告诉我一下原因吧!!,谢谢!!foreach($data as $k=>$v) {
   $post .= $k.'='.rawurlencode($v).'&';
}$port = $matches['port'] ? $matches['port'] : 80;
if($referer == '') $referer = URL;
$out = "$this->method $path HTTP/1.1\r\n";
$out .= "Accept: */*\r\n";
$out .= "Referer: $referer\r\n";
$out .= "Accept-Language: zh-cn\r\n";
$out .= "User-Agent: ".$_SERVER['HTTP_USER_AGENT']."\r\n";
$out .= "Host: $host\r\n";
if($this->cookie) $out .= "Cookie: $this->cookie\r\n";
if($this->method == 'POST') {
$out .= $this->ContentType;
$out .= "Content-Length: ".strlen($this->post)."\r\n";
$out .= "Cache-Control: no-cache\r\n";
$out .= "Connection: Close\r\n\r\n";
$out .= $this->post;
} else {
$out .= "Connection: Close\r\n\r\n";
}
echo $out;
if($timeout > ini_get('max_execution_time')) @set_time_limit($timeout);
$fp = @fsockopen($host, $port, $errno, $errstr, $timeout);
if(!$fp) {
$this->errno = $errno;
$this->errstr = $errstr;
return false;
} else {
stream_set_blocking($fp, $block);
stream_set_timeout($fp, $timeout);
fwrite($fp, $out);
$this->data = '';
$status = stream_get_meta_data($fp);

解决方案 »

  1.   

    不太了解。 但post数据一般是base64编码吧!  你可以查一下(是自动编还是手动编)! 等号表示参数,值要进行base64吧!rawurlencode是url编码吧! 不是数据编码!
      

  2.   

    服务器发过来的数据,是以chunk方式发送的,所以会有这类数据。
    似乎唯一的办法,就是构建适当的header发送过去。