我使用HttpWebRequest
到POST
通過Web服務的字節數組圖片,圖片大小是一樣的東西byte[4096]
HttpWebRequest的基礎連接被關閉
代碼:
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(wsHost);
webRequest.Headers.Add(HttpRequestHeader.AcceptEncoding, "gzip,deflate");
webRequest.Headers.Add(HttpRequestHeader.KeepAlive, "true");
我得到一個錯誤:
The underlying connection was closed. A connection that was expected to be kept alive was closed by the server
是服務器問題還是我的發佈問題?
..當你設置'webRequest.KeepAlive = false;'會發生什麼? –
我將其更改爲false。錯誤仍然相同。事情是這個帖子沒有登錄Fiddler。 –
我假設你已經調試過,發現'wsHost'實際上是一個你發佈的有效URL? –