sagebind / isahc

The practical HTTP client that is fun to use.

Home Page:https://docs.rs/isahc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is there is any way to retrieve HTTP0.9?

Kurusa opened this issue · comments

Got this error
Error: Error { kind: ProtocolViolation, context: None, source: Some(Error { description: "Unsupported protocol", code: 1, extra: None }) }

When retrieving HTTP0.9

Support for HTTP/0.9 is disabled by default in the underlying libcurl library as of version 7.66.0, so unless you disable the static-curl feature and link to an old version of libcurl there is not currently a way of handling HTTP/0.9 responses. However, there is a configuration option that allows you to enable HTTP/0.9 support that we could leverage, though I don't know if libcurl plans on removing this entirely in the future.

Out of curiosity, is this a theoretical problem or are you trying to connect to an actual HTTP/0.9 web server? HTTP/0.9 is 30 years old now so I would be a little surprised to hear that people are still using servers that don't even support HTTP/1.0, though I could be mistaken. However, if there's a legitimate use-case for HTTP/0.9 then I'm not against adding opt-in support for it.