• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • Carey Brown
  • Stephan van Hulst
Bartenders:
  • Frits Walraven
  • fred rosenberger
  • salvin francis

java.io.FileNotFoundException: Response: '400' for url

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am having a method in which I am trying to send the 4 values to the server and get back the response from it , but I when i run the program I get the error :
java.io.FileNotFoundException: Response: '400' for url:

1)When i gave:
String page_to_connect = "http://cd2iis02:80/ifbz/admin/updatestatus.cfm?domain="+s_name+"&requestid="+sreq_id+"&status="+status+"&msg="+ smessage;
I was getting File not found exception (:Response: '400' for url but when i gave the same URL on the browser :
http://cd2iis02:80/ifbz/admin/updatestatus.cfm?name=charles&requestid=6442&status=0&msg=Command%20completed%20successfully
I got a successfull page , the browser is showing the response successfully.
What could be the possible reason for this. The server accepts Http request . Can someone tell me where i can find good examples on sending request to server using Http request object .

Thanks,
Regards,
John
 
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Looks like your passing different parameters when typing in to your browser compared to in your code.
Try fixing that and see if it does any good. I would not think that one would get a FileNotFoundException from passing an incorrect URL parameter though. Instead the cfm page you are requesting would just choke, and hopefully spit out some HTML requesting proper parameters. Try fixing your URL parameters and if that doesn't work maybe paste some more of your code here so we can see it.
Good luck!
 
L.John
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanking you for your reply.
There is a difference in the parameters i am passing. I wanted to check whether the server is accepting the request either through the browser and when i run my application.
The server can only accept HTTP request and i was not sending an http request , but using an URL and URL Connection class and reading and writing to the input and output stream.
I hope there would be way out URLEncoder class also .
I gave the proper Http request along with the values and now its working fine. I am able to retrieve the response back from the server
Thanks once again for your help.
Regards,
John
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic