Sobes.tech
Senior

[name] asked: What status code will the API return if there is a typo in the host?

sobes.tech AI

Answer from AI

If there is a typo in the API request regarding the host (for example, an incorrect domain name), the HTTP request simply won't reach the server, and consequently, the API will not return any status code. In this case, the client library or browser will report a connection error (for example, DNS lookup failure or connection refused).

Therefore, the HTTP status code will not be received because the request did not reach the server. Network or DNS errors do not have HTTP status codes.

Example of an error in curl:

curl: (6) Could not resolve host: wronghostname.com
[name] asked: What status code will the API return if… - sobes.tech