-2

I made some code for sending data to other url and that was written with spring and java, using 'httpclient' class. About that code please check this question that I made

how to get http status value?

I have a problem with request and response of http and that was solved. My question was about http status and finally I got the truth that request doesn't carry status value.

Anyway, so I have to made some documents for our code to show to customers and I'm confused of response tab.

What I wrote is response:

[success] name = mister age = 30 [fail] name= null age = null

and my team manager want like this response:

[success] 200 success [fail] 400 error

Am I right or my boss right? But when I think, if request doesn't carry the http status value, how could I wrote like my team manager said? Or how can I write that side?

Community
  • 1
  • 1

1 Answers1

1

Please read the comments below your last two questions a bit more carefully. (I send some values to another url and about that and how to get http status value?)

As it states there your team manager is correct (no need for asking it a third time). I think you still confuse an HTTP request and response. The request is end by the client requesting a specific resource. The server then answers with a result and a status code depending on whether it was successful (200 OK) or not (400 Bad Request, 404 Not Found, ...).

The status code is send by the server in an HTTP response. It is independent of the result that is included in the response, which would be your data values name and age for example.

Community
  • 1
  • 1
Hannes Küttner
  • 908
  • 7
  • 9