Closed jacpete closed 2 years ago
After doing some exploring of the source code. It looks like the http_error.character
method uses HEAD()
under the hood retrieves the error code and assesses if its greater than 400.
The response it returns is error 405 which is "Method Not Allowed". This tells me that it is likely that the server at that URL has disabled HEAD requests, but in my example I know a GET request succeeds. The solution in the package I am working on is to use httr::http_error(httr::GET(url))
as the url's I am working with never have a very big body and not a concern to retrieve it as well.
I will close the issue as this is a sufficient workaround.
I am having some issues with unexpected results from
http_error()
. Documentation and examples show that the input can pass a url to the function or a response object. However, I am having issues with the url: https://egisdata.baltimorecity.gov/egis/rest/services/CityView/Liquor_Licenses/MapServer/0. If I just pass the url tohttp_error
I get TRUE (there was an error), but if I pass aGET
response for the url tohttp_error
I get FALSE (no error; the expected result). Am I missing something or is this an issue withhttp_error
?Unexpected Results
Expected Results
Environment Information