Skip to main content
Copy edited (e.g. ref. <https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol>, <https://en.wiktionary.org/wiki/didn't#Contraction>, <https://en.wikipedia.org/wiki/HTTPS>, and <https://en.wikipedia.org/wiki/Sentence_clause_structure#Run-on_sentences>).
Source Link

Many people take httpHTTP status code as “successful communication with the server”.

Now if a customer wants to buy a $200US$200 item and has only $100US$100 in their account, the JSON response will be “failure, insufficient funds”. But as far as httpHTTP is concerned, everything went just fine: It delivered a purchase order, and successfully returned back to the caller that the purchase failed.

So you get a status 200. You would get something in the 400 range if there was actually some communication failure. In that case you have no idea if there is money in the account or not, we didnt. We didn’t get that far.

Note there are situations where we don’t even get an httpHTTP status: if the server is down, or if httpsHTTPS negotiation fails, so your application didn’t even manage to reach the server.

Many people take http status code as “successful communication with the server”.

Now if a customer wants to buy a $200 item and has only $100 in their account, the JSON response will be “failure, insufficient funds”. But as far as http is concerned, everything went just fine: It delivered a purchase order, and successfully returned back to the caller that the purchase failed.

So you get a status 200. You would get something in the 400 range if there was actually some communication failure. In that case you have no idea if there is money in the account or not, we didnt get that far.

Note there are situations where we don’t even get an http status: if the server is down, or if https negotiation fails, so your application didn’t even manage to reach the server.

Many people take HTTP status code as “successful communication with the server”.

Now if a customer wants to buy a US$200 item and has only US$100 in their account, the JSON response will be “failure, insufficient funds”. But as far as HTTP is concerned, everything went just fine: It delivered a purchase order, and successfully returned back to the caller that the purchase failed.

So you get a status 200. You would get something in the 400 range if there was actually some communication failure. In that case you have no idea if there is money in the account or not. We didn’t get that far.

Note there are situations where we don’t even get an HTTP status: if the server is down, or if HTTPS negotiation fails, your application didn’t even manage to reach the server.

Source Link
gnasher729
  • 49.4k
  • 4
  • 71
  • 137

Many people take http status code as “successful communication with the server”.

Now if a customer wants to buy a $200 item and has only $100 in their account, the JSON response will be “failure, insufficient funds”. But as far as http is concerned, everything went just fine: It delivered a purchase order, and successfully returned back to the caller that the purchase failed.

So you get a status 200. You would get something in the 400 range if there was actually some communication failure. In that case you have no idea if there is money in the account or not, we didnt get that far.

Note there are situations where we don’t even get an http status: if the server is down, or if https negotiation fails, so your application didn’t even manage to reach the server.