我是
PHP的新手.我发送PHP curl POST请求后尝试从响应中获取Header.客户端将请求发送到服务器,服务器使用Header发回响应.这是我发送POST请求的方式.
@H_301_10@$client = curl_init($url); curl_setopt($client,CURLOPT_CUSTOMREQUEST,"POST"); curl_setopt($client,CURLOPT_POSTFIELDS,$data_string); curl_setopt($client,CURLOPT_HEADER,1); $response = curl_exec($client); var_dump($response);
这是我从浏览器获得的服务器的头响应
HTTP/1.1 200 OK Date: Wed,01 Feb 2017 11:40:59 GMT Authorization: eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1c2Vycy9CYW9CaW5oMTEwMiIsIm5hbWUiOiJhZG1pbiIsInBhc3N3b3JkIjoiMTIzNCJ9.kIGghbKQtMowjUZ6g62KirdfDUA_HtmW-wjqc3ROXjc Content-Type: text/html;charset=utf-8 Transfer-Encoding: chunked Server: Jetty(9.3.6.v20151106)