【发布时间】:2017-09-14 08:09:51
【问题描述】:
您好,我正在研究 houzz api,我在邮递员中得到响应,但使用 curl 我没有得到任何响应,得到空白页面。这是代码:-
$ch = curl_init();
$headers = array(
'X-HOUZZ-API-SSL-TOKEN: dfgs4g65sd4fg654a54rfg65df4g654a1',
'X-HOUZZ-API-USER-NAME: web_test',
'X-HOUZZ-API-APP-NAME: web_test');
curl_setopt($ch, CURLOPT_URL, "https://api.houzz.com/api?format=xml&method=getListing&ProductId=285599"); # URL to post to
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1 ); # return into a variable
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); # custom headers, see above
$result = curl_exec( $ch ); # run!
curl_close($ch);
print_r($result);
当在邮递员中检查相同的东西时,我得到了这些结果
<?xml version="1.0" encoding="utf-8"?>
<GetListingResponse>
<Ack>Error</Ack>
<Errors>
<Error>
<ErrorCode>25001</ErrorCode>
<ShortMessage>No Listing Found</ShortMessage>
<LongMessage>No listing was found with the given SKU or Product ID.</LongMessage>
</Error>
</Errors>
</GetListingResponse>
我也试过curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
请帮帮我,谢谢。
【问题讨论】:
标签: java php asp.net web-services curl