I’m using HttpWebRequest.BeginGetRequestStream to make POST requests to the remote server. Let’s presume that the network connection is lost during this process and response was not received. Is there any way to detect whether the request was sent to the remote server or not? Thank you!
I’m using HttpWebRequest.BeginGetRequestStream to make POST requests to the remote server. Let’s presume that
Share
There’s no way to know what the server received and processed without some response from it. You need to handle this at the application layer, with another request whose response you do receive.
That is, you’ll detect that the connection was lost and you didn’t receive a response, so your applications sends another request, either repeating the same request (which the server must handle appropriately) or sending a query “did you receive and process that request with transaction ID XYZ?”.