HTTP/ Servlet/URL/ GET/ POST / HELP!!!!  
Author Message
cormacodonnell





PostPosted: 2005-2-17 0:01:00 Top

java-programmer, HTTP/ Servlet/URL/ GET/ POST / HELP!!!! I have a small problem,

I am sending a few parameters to a company.


URL url = new URL("http://www.some.com/where?usr=name&password=pass&msg=ello");


now to connect to the url i simply open a connection:

url.openStream();

This sends my parameters( usr, password , msg), this works fine.


Thing is that the person i am sending these parameters to is sending
back parameters, namely; status_code and status_description

How can i get my hands on these parameters


I am doing this in a servlet

Thanks in advance,


Cormac
 
Ryan Stewart





PostPosted: 2005-2-17 20:48:00 Top

java-programmer >> HTTP/ Servlet/URL/ GET/ POST / HELP!!!! "Cormac O'Donnell" <email***@***.com> wrote in message
news:email***@***.com...
>I have a small problem,
>
> I am sending a few parameters to a company.
> URL url = new
> URL("http://www.some.com/where?usr=name&password=pass&msg=ello");
>
> now to connect to the url i simply open a connection:
> url.openStream();
>
> This sends my parameters( usr, password , msg), this works fine.
> Thing is that the person i am sending these parameters to is sending
> back parameters, namely; status_code and status_description
> How can i get my hands on these parameters
>
> I am doing this in a servlet
Have you tried reading from the stream that you opened?


 
Wendy S





PostPosted: 2005-2-17 23:55:00 Top

java-programmer >> HTTP/ Servlet/URL/ GET/ POST / HELP!!!! "Cormac O'Donnell" <email***@***.com> wrote

> Thing is that the person i am sending these parameters to is sending
> back parameters, namely; status_code and status_description
>
> How can i get my hands on these parameters
>
> I am doing this in a servlet

What are some examples of these codes and descriptions? Are you looking
for the 200/OK or 404/Not Found responses? Those aren't parameters, they
are http status codes.
See: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html

If it's not that, then the data you want is probably in the body of the
request. Look at what you've recieved and figure out how to parse it.

--
Wendy