我正在连接到网络服务。第一个请求是带有登录凭证的SOAP内容。如果凭据正确,则使用新位置的307 Temp Redirection
响应服务。但是,新位置需要不同的SOAP内容。下面的代码返回两个带有307
和200
的标头。
$login_xml = file_get_contents("login.xml");
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://10.1.10.111:8001");
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: text/xml"));
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, "$login_xml");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);
$response = curl_exec($ch);
如何更改重定向位置的请求内容?
谢谢