File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Response: '400' for url Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark " Response: Watch " Response: New topic
Author Response: '400' for url


Joined: Aug 29, 2001
Posts: 24
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 : 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 :
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 .

BJ Grau
Ranch Hand

Joined: Jul 10, 2001
Posts: 234
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!

Joined: Aug 29, 2001
Posts: 24
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.
I agree. Here's the link:
subject: Response: '400' for url
It's not a secret anymore!