Open tit opened 9 years ago
Some server returns code 301, but Unirest redirects it and returns code 200.
The correct behavior of returning code 301
$ curl --head http://httpbin.org/status/301 | head -n 1 HTTP/1.1 301 MOVED PERMANENTLY
The incorrect behavior of returning code 200
$ ruby -r unirest -e 'puts Unirest.get("http://httpbin.org/status/301").code' 200
How can I fix it?
Unirest.setHttpClient(org.apache.http.impl.client.HttpClients.custom() .disableRedirectHandling() .build())
That will fix it. (at least in Java)
Some server returns code 301, but Unirest redirects it and returns code 200.
The correct behavior of returning code 301
The incorrect behavior of returning code 200
How can I fix it?