Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/332.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Google App Engine上使用url获取PHP API获取最终url?_Php_Python_Google App Engine - Fatal编程技术网

如何在Google App Engine上使用url获取PHP API获取最终url?

如何在Google App Engine上使用url获取PHP API获取最终url?,php,python,google-app-engine,Php,Python,Google App Engine,与Python URL获取API一样,在Google App Engine上没有任何方法可以获取PHP中的最终URL。以下是其在中的访问方式: 不幸的是,除了禁用follow_location和手动解析$http_response_头之外,目前还无法直接获取最终的_url。是的,我知道这一点,但这不是与Python不同的最佳方法。将本机PHP对象映射到urlfetch可能会有所帮助,该对象将公开API必须提供的所有内容。请在此处随意添加功能请求: >>> from google

与Python URL获取API一样,在Google App Engine上没有任何方法可以获取PHP中的最终URL。以下是其在中的访问方式:


不幸的是,除了禁用follow_location和手动解析$http_response_头之外,目前还无法直接获取最终的_url。

是的,我知道这一点,但这不是与Python不同的最佳方法。将本机PHP对象映射到urlfetch可能会有所帮助,该对象将公开API必须提供的所有内容。请在此处随意添加功能请求:
>>> from google.appengine.api import urlfetch
>>> urlfetch.fetch('http://google.com/').final_url
'http://www.google.com/'