O
O
one__for__one2018-06-15 12:19:57
C++ / C#
one__for__one, 2018-06-15 12:19:57

How to determine what came in response to an http request?

Hello!
Preface... There is a VoIP phone, it understands http requests.
I generate a request for it from C# and send the request:

WebRequest request = WebRequest.Create ("http://www.contoso.com/default.html");
WebResponse response = request.GetResponse ();

On the old version of the firmware, everything was fine: the phone rang. We updated the firmware and now at the line
WebResponse response = request.GetResponse ();
An error occurs: Additional information: The server has violated the protocol. Section=ResponseHeader Detail=Carriage return must be followed by a linefeed

Q:
How can I see what response from the phone came on this line?
WebResponse response = request.GetResponse ();
Tried like this, but null value in variable
try
{
    resp = (HttpWebResponse)webr.GetResponse();
}
catch (WebException e)
{
    resp = (HttpWebResponse)e.Response;
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question