Link to home
Start Free TrialLog in
Avatar of Iain Hodgen
Iain Hodgen

asked on

C# .NET HttpWebResponse Read the content when an error is returned

I am error trapping a json call error in .NET.

Documentation says this would be the response on error:

Error Response      Code: 401 Unauthorized
Content: {"connection":"Error","message":"Please check the following; a) the credentials you have provided are correct, b) the IP address you are requesting from is authorised, c) your account is not suspended."}


Question is I can see the Code: 401 Unauthorized error but cannot get the content (a,b,c) with the details of what happen to cause the auth error.

Can this be done in .NET?
ASKER CERTIFIED SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I have recommended this question be closed as follows:

Accept: Ryan Chong (https:#a42138443)

If you feel this question should be closed differently, post an objection and the moderators will review all objections and close it as they feel fit. If no one objects, this question will be closed automatically the way described above.

frankhelk
Experts-Exchange Cleanup Volunteer