HTTP/ Servlet/URL/ GET/ POST / HELP!!!!

C

Cormac O'Donnell

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
 
R

Ryan Stewart

Cormac O'Donnell said:
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?
 
W

Wendy S

Cormac O'Donnell said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top