Google app engine GAE-PHP-URL获取

Google app engine GAE-PHP-URL获取,google-app-engine,Google App Engine,根据呼叫其他应用程序引擎应用程序时的文档: If you are making requests to another App Engine app, you should consider telling the UrlFetch service to not follow redirects when invoking it. 到目前为止,还没有关于如何编辑函数和告诉服务不要遵循重定向的文档,所以有人知道诀窍吗?您必须设置 follow_redirects = false 调用fetch

根据呼叫其他应用程序引擎应用程序时的文档:

If you are making requests to another App Engine app, you should consider telling the UrlFetch service to not follow redirects when invoking it.
到目前为止,还没有关于如何编辑函数和告诉服务不要遵循重定向的文档,所以有人知道诀窍吗?

您必须设置

follow_redirects = false
调用fetch时

带fetch的标准调用

fetch(url, payload=None, method=GET, headers={}, 
allow_truncated=False, follow_redirects=True, deadline=5,
validate_certificate=False)
将“跟随”重定向更改为false,如下所示

 fetch(url, payload=None, method=GET, headers={}, 
 allow_truncated=False, follow_redirects=False, deadline=5,
 validate_certificate=False)
PHP

$context = [
    'http' => [
    'method' => 'get',
    'header' => "custom-header: custom-value\r\n" . "custom-header-two: custome-value-2\r\n",
    'content' => $data,
    'follow_location' => false,
    ]
];

我猜这是针对Python的,PHP也一样吗?如果我没有错的话,应该试试。