GeckoWebBrowser 写POST数据,异常:Length Required

.Net技术 码拜 9年前 (2016-03-02) 1071次浏览
MimeInputStream postStream = MimeInputStream.Create();
//byte[] postBytes = url.GetEncodedPostData();
//postStream.Read(postBytes, 0, postBytes.Length);
postStream.SetData(“”);
//postStream.SetLength(0);    // 异常:未实现该方法或操作。
geckoWebBrowser1.Navigate(txtURL.Text, Gecko.GeckoLoadFlags.None, “”, postStream);        // 测试 Post
// Navigate时,发生异常:Length Required
问一下,GeckoWebBrowser 怎么样写POST数据?
解决方案

100

意思就是用postData必须在最后的参数上指定Content-Length和Content-Type
例如这样

"Content-Type: application/x-www-form-urlencoded\r\nContent-Length: 50"

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明GeckoWebBrowser 写POST数据,异常:Length Required
喜欢 (0)
[1034331897@qq.com]
分享 (0)