Java HTTP getResponseCode returns 200 for non-existent URL

后端 未结 5 370
长情又很酷
长情又很酷 2021-01-25 03:04

I was expecting this code to return a 404, however it produces the output :

\"Response code is 200\"

Would it be possible to learn how to differentiate between e

5条回答
  •  逝去的感伤
    2021-01-25 03:41

    Like @spgennard - I think this is most likely a DNS issue.

    • The URL you have chosen is owned by a DNS speculator.
    • The URL you have chosen is "parked" by a DNS provider.
    • Your ISP is messing with your DNS results to send your browser to some search page.

    It is also possible that you are accessing the web via a proxy, and the proxy is doing something strange.

    The way to diagnose this is to look at the other information in the HTTP responses you are getting, particularly the response body.

提交回复
热议问题