0

first of all i asked something before and i got another question please take a look this one first

I send some values to another url and about that

i made a question and got an answer, and finally i have another question if like i said that above question, i send some values to other url using spring and httpclient like this,

HttpClient client = HttpClientBuilder.create().build();
HttpPost post = new HttpPost("http://test.com");
post.setEntity(new UrlEncodedFormEntity(values arrayList));
(values arrayLists that i made is 
arrayList.add(new BasicNameValuePair("name","mister"));
HttpResponse response = client.execute(post);

if i send some value like that,how i get http status value at the receiving page, "http://test.com" if i assume that receiving page using spring and java how to code to get http status value?

Community
  • 1
  • 1
  • The http status is something the http server sends as part if the response, there is no such thing in the request, so the sever cannot "get" that value. – arkascha Apr 18 '17 at 05:44
  • http://stackoverflow.com/questions/43462707/i-send-some-valuse-to-another-url-and-about-that/43463446#43463446 this question that i make answered there is http status value......so i asked this....then you mean there is no way to get http status value or there is no http status value at request?? – honey.E.seo Apr 18 '17 at 06:20
  • It appears that you did not yet understand how the http protocol works, the difference between request and response. Once more: the request does _not_ carry a status code, the response does. I suggest you take a look at some raw http communication to understand the details (using a network sniffer for example) or at least you open your browsers console and inspect the details of requests you see in the network tab in there. – arkascha Apr 18 '17 at 06:34
  • that is what i want to know. ...really thank you to help me. i read https://www.w3.org/Protocols/rfc2616/rfc2616.html this one but i couldn't understand yet...my team manager told me http always has request and response...but..i only wrote a response....then what is my request...?i just send some values to that test url...i think i'm going crazy..that test url is request? what is my request?help me... – honey.E.seo Apr 18 '17 at 07:11
  • A client always sends a request to a server, that is how the two terms are defined. The Server returns a response, which indeed does include a status code. It might be that you currently ignore that response, but is there. As said: take a look at the communication you initiate with your request. You will find a server response... – arkascha Apr 18 '17 at 07:23

0 Answers0