Error: This Operation cannot be performed after request has been submitted

前端 未结 2 545
独厮守ぢ
独厮守ぢ 2021-01-23 06:35

I\'ve written code about httpwebrequest and httpwebresponse . I need to send data to server but got this exception \"This operation cannot be performed

2条回答
  •  时光说笑
    2021-01-23 07:28

    The exception tells you what you need to know; HTTP is request => response, so if you have asked for the response (GetResponse()) you have implicitly said "my request is complete; give me the response". Move the GetRequestStream() code above the GetResponse().

提交回复
热议问题