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 .
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!
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