Questions tagged [system.net.webexception]

system.net.webexception is a .NET exception is thrown when an error occurs while accessing the network through a pluggable protocol.

system.net.webexception is a .NET exception is thrown when an error occurs while accessing the network through a pluggable protocol.

174 questions
2
votes
1 answer

Method seems unavailable for 403 response body in C#

Here is my web request code block, scroll down to the bottom of it to the catch exception try { var webRequest = System.Net.WebRequest.Create (WEBSERVICE_URL); if (webRequest != null) { webRequest.Method = "POST"; …
2
votes
1 answer

Visual Studio Xamarin Android System.Net.WebException: Error: ConnectFailure (Network is unreachable)

my Android app created in Xamarin has problem with internet connection, below is error code. Time Device Name Type PID Tag Message 10-09 05:04:52.256 Genymotion Samsung Galaxy S7 - 6.0.0 - API 23 - 1440x2560 Error 1453 AndroidRuntime …
2
votes
2 answers

HTTP Protocol violation when downloading webpage using HtmlAgilityPack

I'm trying to parse download pages from www.mediafire.com, but i really often get a System.Net.WebException with the following message, when i try to load a page to a HtmlDocument: The server committed a protocol violation.…
Flagbug
  • 2,093
  • 3
  • 24
  • 47
2
votes
2 answers

System.Net.WebException: The server committed a protocol violation

I have the following code to make a call that in turn returns xml: private string Send(string url) { try { HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); using (HttpWebResponse response =…
keeg
  • 3,990
  • 8
  • 49
  • 97
2
votes
2 answers

C# - WebClient - Remoteserver send an 503 error

I wrote a little windows forms program that sends a string to google translate. The target framework is .Net 4.5.2 public string TranslateText(string input, string languagePair) { try { …
Schlodi
  • 149
  • 1
  • 15
2
votes
2 answers

Can't get ResponseStream from WebException

I have a desktop client, that communicates with serverside via Http. When server has some issues with data processing it returns description of an error in JSON in Http response body with proper Http-code (mainly it is HTTP-400). When i read…
maiksaray
  • 358
  • 2
  • 14
2
votes
1 answer

What is the main purpose of WebExceptionStatus.Success?

I am a bit confused about the purpose of the enum value Success of the WebExceptionStatus enumeration. I did a search and did not find this enumeration being used outside the WebException class. This is very confusing to me. Why would an exception…
CSharpenter
  • 722
  • 8
  • 21
2
votes
1 answer

Getting WebException "The operation has timed out" at System.Net.HttpWebRequest.GetResponse() when reading images and video from amazon s3

Here is my code to create image url : List lstFileURL = AmazonFunction.GetFileUrlList(BucketName, BucketFolderName, Time); create amazons3client object : private static AmazonS3Client GetS3Client() { …
2
votes
1 answer

The remote name could not be resolved: 'api-3t.sandbox.paypal.com'

I am using paypal NVP api in an ecommerce website. It was working fine before but now it is throwing "System.Net.WebException: The remote name could not be resolved: 'api-3t.sandbox.paypal.com'" Exception. I also tried api.sandbox.paypal.com but no…
sanjeev
  • 1,407
  • 2
  • 18
  • 30
2
votes
2 answers

.NET throws WebException instead of setting StatusCode

I have the following code in my method: // make the FTP request var request = (FtpWebRequest)WebRequest.Create(serverUri); request.KeepAlive = true; request.Method = WebRequestMethods.Ftp.MakeDirectory; return…
NathanDykstra
  • 85
  • 1
  • 11
2
votes
1 answer

How do I reissue a webrequest? Must I recreate Webclient?

The following code gets stuck in a while loop when an exception is encountered. This is because GetResponse is caching the data. According to fiddler, no data after the first request is issued. Is it a best practice to recreate the webclient to…
makerofthings7
  • 60,103
  • 53
  • 215
  • 448
2
votes
1 answer

C# System.Net.WebException Retrieving custom 404 message

I'm working on a client for a webservice that returns standard Status Codes (404, 200 etc) as well a custom json message. I haven't been able to find a property of the WebException that contains the custom message. Any ideas on how to get a hold of…
Andrew Harry
  • 13,773
  • 18
  • 67
  • 102
2
votes
2 answers

HttpWebRequest - GetResponse() - WebException ReceiveFailure

I have a WCF service that is running frequent (1000+) outbound connections per minute to external APIs. My code throws the following exceptions frequently, but not always showing that is is a WebException with the WebException status property being…
TheJediCowboy
  • 8,924
  • 28
  • 136
  • 208
2
votes
1 answer

WebClient UploadFile errors

I am trying to upload files to a web server using System.Net.WebClient.UploadFile but I keep getting a WebException. Specifically, I am getting 3 errors. I have no idea why I am not getting the same error, but they all seem to be related based on…
Brian
  • 37,399
  • 24
  • 94
  • 109
2
votes
1 answer

try is not catching WebException

i have the following function will will get me the html source of some website over a proxy, its working fine except some times when server returns 503(server unavailable) or any other exception it never goes into the catch statement. in the catch…
user1590636
  • 1,174
  • 6
  • 26
  • 56
1 2
3
11 12