According to https://cloud.google.com/appengine/docs/flexible/go/migrating#url_fetch ,in flexible environment we can use http lib instead of urlFetch which is supposed to add GAE related headers.
My app is in flexible environment but "X-Appengine-Inbound-Appid" is not set when it makes http request.
My app is in python using flask framework.
To test is the right headers got set, I'm making http request to the same app (different endpoint). But the inbound request doesn't have "X-Appengine-Inbound-Appid" in the headers. This is how I made http call:
@app.route('/ping')
def ping():
res = requests.get("https://myapp.appspot.com/pong")
print res.status_code
return "ping"
@app.route('/pong')
def pong():
print request.headers
return "pong"
print request.headers shows that no "X-Appengine-Inbound-Appid" was set.
Anyone knows how to solve the issue? Thanks!