如何在Google App Engine中禁止urlfetch标头警告?

aln*_*h29 8 python google-app-engine urlfetch

每当我在GAE上使用urlfetch请求外部URL时,我都会收到以下警告:

WARNING  2012-03-16 15:37:21,474 urlfetch_stub.py:428] Stripped prohibited headers from URLFetch request: ['Content-Length']
Run Code Online (Sandbox Code Playgroud)

我明白为什么会这样,而且我无法阻止潜在的问题.有没有办法可以抑制这个警告,以免堵塞日志?当然,我仍然想知道urlfetch想要记录的任何其他警告/错误.

Gui*_*sum 5

无法从日志中禁止它,您必须禁止Content-type标头.

  • 除非我弄错了,urlfetch会抱怨你在请求中设置了一个标题,所以服务器的行为不会进入它.(而且我不明白为什么在响应中会禁止Content-Length - 这会不会使几乎所有的响应都无效?) (4认同)