PHP curl exec在好的url上失败了

时间:2016-11-17 16:38:07

标签: php curl

我使用curl进行了其他调用,但是他们访问了另一个网站,这是网址:https://api.eveonline.com/account/APIKeyInfo.xml.aspx?keyID=5710518&vCode=qIav0wxj9V8T7AJmKn58FWLW6x55un06pT8sRFljnBFagvbuwbX2cSWLoO4gkjvS

我认为正确的代码是

            $service_url = 'https://api.eveonline.com/account/APIKeyInfo.xml.aspx?keyID=5710518&vCode=qIav0wxj9V8T7AJmKn58FWLW6x55un06pT8sRFljnBFagvbuwbX2cSWLoO4gkjvS';
            $curl = curl_init( $service_url );
            curl_setopt( $curl, CURLOPT_RETURNTRANSFER, true );
            $curl_response = curl_exec( $curl );
            if ( $curl_response === false ) {
                $info = curl_getinfo( $curl );
                curl_close( $curl );
                die( 'error occured during curl exec. Additioanl info: ' . var_export( $info ) );
            }
            curl_close( $curl );
            $xml = simplexml_load_string( $curl_response );
            print_r($xml);

所有的错误信息都说是卷曲执行期间出错了。没有其他信息,我在谷歌帮助中找不到任何内容

0 个答案:

没有答案