0

My httr POST() returns error: HTTP/1.1 505 HTTP Version Not Supported

I see in the config$options and httr_options() there is an option: http_version CURLOPT_HTTP_VERSION integer

It expects an integer, but there is no explanation of what integers are available and what version they correspond to. I've looked at curl_docs('http_version') and I can't find anything helpful there. I've tried 0, 1, and 2 and they all give me the same error: HTTP/1.1 505 HTTP Version Not Supported

Any help is appreciated!

Stefan P
  • 3
  • 1
  • You should attempt to provide some sort of [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). Right now it's not clear what code you are running at all. Are you sure the server you are posting to does not support HTTP1.1? What version does it support? Possibly related: https://stackoverflow.com/questions/20114175/curl-response-says-http-version-not-supported-error-505 – MrFlick Nov 09 '17 at 21:18
  • 1
    `POST("https://httpbin.org/post", config(http_version=1), verbose())` will show that it does indeed obey the option (they're based on enums in libcurl and if you look at the headers in https://github.com/curl/curl/blob/master/include/curl/curl.h you can intuit what the values are. You should terminate your R session so there are no handles for httr/curl to re-use. That will cause it to ignore that particular configuration setting. – hrbrmstr Nov 09 '17 at 22:13

0 Answers0