Question

I am using HttpWebRequest to download a remote file, however i get a 504 error. I pasted the url in firefox and the first and 3rd try it took 16seconds, the 2nd nothing happened (it looked like it timed out).

How do i decrease the 504 error? Would changing HttpWebRequest timeout help? should i attempt to retry the file (lets say 3 times) if i receive a 504 error?

Was it helpful?

Solution

That's a server problem. There's no way for you to prevent that. I would retry a couple of times adding some Thread.Sleep in between.

OTHER TIPS

5xx is a server error. Look at the entity body of the response to see if the server gives any hint as to why this is happening.

You can get the entity body by getting the Response from the WebException object.

Try putting an & at the end of your POST request body:

variable=value&

Maybe the server is waiting for POST data.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top