不包括“期望:100-继续”来自HttpWebRequest POST的标头 [英] Excluding the "Expect: 100-Continue" header from HttpWebRequest POSTs
问题描述
我正在使用HttpWebRequest发布到不知道如何处理Expect 100标头的服务器。 显然这不是一个罕见的问题。 菲尔·哈克几年前在博客上发表了一篇博文,其中包括一个简单的解决方案:
http://haacked.com/archive/2004/05/15/http-web-request-expect-100-continue.aspx
建议的解决方案是设置System.Net.ServicePoint.Expect100Continue。 但ServicePoint似乎是WinRT API收缩的不幸受害者,所以我无法访问它。 是否有替代解决方法?
Robert Levy
嗨Robert,
我将研究如何防止在没有ServicePoint或ServicePointManager的情况下发送Expect:100-continue标头并返回给您。
- Rob
I'm using HttpWebRequest to post to a server which doesn't know how to deal with the Expect 100 header. Apparently this isn't an uncommon problem. Phil Haack blogged about it several years ago, including a simple solution: http://haacked.com/archive/2004/05/15/http-web-request-expect-100-continue.aspx
The solution proposed there is to set System.Net.ServicePoint.Expect100Continue. But ServicePoint seems to have been an unfortunate victim of the WinRT API shrinkage so I can't access it. Is there an alternative workaround?
Robert Levy
Hi Robert,
I'll look into how to prevent sending the Expect: 100-continue header without ServicePoint or ServicePointManager and get back to you.
--Rob
这篇关于不包括“期望:100-继续”来自HttpWebRequest POST的标头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!