如何设置HTTP请求的内容类型?
我尝试了以下方法:
我尝试了以下方法:
$headers['Accept'] = 'application/xml';
$headers['Content-Type'] = 'application/xml';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
而这是结果:
HTTP/1.1 200 OK
Content-Encoding: gzip
Content-Type: text/html;charset=UTF-8
Date: Thu, 22 Mar 2012 14:04:36 GMT
但到目前为止没有运气...
我需要做什么来在我的HTTP响应中获得 Content-Type: application/xml
?
Content-Type: application/xml
响应? - MichielContent-Type: application/xml
。 - Michiel