Get HTTP requests and responses made using HttpWebRequest/HttpWebResponse to show in Fiddler

The Fiddler FAQ gives the answer to this. You essentially route your HTTP traffic through Fiddler (i.e. Use Fiddler as a proxy). Here’s some links that will help: Fiddler Web Debugging – Configuring Clients Which in turn links to here: Take the Burden Off Users with Automatic Configuration in .NET You can achieve this via … Read more

How to process WebResponse when .NET throws WebException ((400) Bad Request)?

Using a try/catch block like this and processing the error message appropriately should work fine: var request = (HttpWebRequest)WebRequest.Create(address); try { using (var response = request.GetResponse() as HttpWebResponse) { if (request.HaveResponse && response != null) { using (var reader = new StreamReader(response.GetResponseStream())) { string result = reader.ReadToEnd(); } } } } catch (WebException wex) { … Read more

Authentication failed because the remote party has closed the transport stream exception when getting a response from webservice

I found the answer, It was because the third party webservice we were calling did not support TLS 1.0 they supported 1.1 and 1.2. So I had to change the security protocol. ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

Uses of content-disposition in an HTTP response header

Note that RFC 6266 supersedes the RFCs referenced below. Section 7 outlines some of the related security concerns. The authority on the content-disposition header is RFC 1806 and RFC 2183. People have also devised content-disposition hacking. It is important to note that the content-disposition header is not part of the HTTP 1.1 standard. The HTTP … Read more