locked
"The remote server returned an error: (400) Bad Request." RRS feed

  • Question

  • Hi

    I have an application which downloads files from a website

    using object of webclient

    // fileBytes = client.UploadValues(URL, "POST", getFileValues);

    it is running and downloading many files , it runs properly for some time  but after variable time like ~30 minuts.

    it gives me

    error: "The remote server returned an error: (400) Bad Request.".

    Can anyboduy help me on this.

    Regards;

    Naseer

     

     

     

     

    Monday, September 19, 2011 4:47 PM

Answers

  • We can't tell you exactly what is wrong but can advise how it can be troubleshot:

    -400 errors = bad request to server.  So that would mean you sent a malformed URL to the server that it could not process.

    -My guess is that the code you posted resides inside of a loop.

    -You need to write code to catch this error and dump/view your Locals: URL and getFileValues

    -I bet when you manually put those variables into your broswer it too will throw an error.  You can work it out from there.

     

    Yes, writting code for the sole purpose of trouble-shooting can be unfun but is required.

    So if this is what you are going to do please mark this as the answer.  If more questions come up later post again. 

    cs


    • Edited by CountryStyle Monday, September 19, 2011 6:50 PM
    • Marked as answer by Lie You Wednesday, September 28, 2011 7:03 AM
    Monday, September 19, 2011 6:49 PM

All replies

  • Naseer,

    Can you please be more specific.
    Multiple reasons may exist for the error.

    Regards,
    Michéle johl

    Monday, September 19, 2011 5:18 PM
  • We can't tell you exactly what is wrong but can advise how it can be troubleshot:

    -400 errors = bad request to server.  So that would mean you sent a malformed URL to the server that it could not process.

    -My guess is that the code you posted resides inside of a loop.

    -You need to write code to catch this error and dump/view your Locals: URL and getFileValues

    -I bet when you manually put those variables into your broswer it too will throw an error.  You can work it out from there.

     

    Yes, writting code for the sole purpose of trouble-shooting can be unfun but is required.

    So if this is what you are going to do please mark this as the answer.  If more questions come up later post again. 

    cs


    • Edited by CountryStyle Monday, September 19, 2011 6:50 PM
    • Marked as answer by Lie You Wednesday, September 28, 2011 7:03 AM
    Monday, September 19, 2011 6:49 PM