okhttp icon indicating copy to clipboard operation
okhttp copied to clipboard

OkHttpClient implies that it can use HTTP/1.0. It can not.

Open hgschmie opened this issue 12 years ago • 6 comments

There is a constant, Protocols.HTTP_1_0. However, setting the client to only use HTTP 1.0 will cause the check in https://github.com/square/okhttp/blob/master/okhttp/src/main/java/com/squareup/okhttp/OkHttpClient.java#L435 to trigger.

I am trying to use okhttp to talk to a server that only speaks HTTP 1.0 and it seems that this is not possible.

hgschmie avatar Jul 08 '14 16:07 hgschmie

What happens if you attempt to connect to this server without configuring protocols? Does it work? I'm tempted to fix this by just adding some documentation to that API.

swankjesse avatar Jul 21 '14 03:07 swankjesse

I have the same problem:

Response code: Response{protocol=http/1.0, code=500, message=Internal Server Error, url=https://wilhelm-gym.net/idesk/addr/my.php/}

janheinrichmerker avatar Sep 25 '14 16:09 janheinrichmerker

It seems like OkHttp detects HTTP 1.0 where Browsers like Chrome detect HTTP 1.1

janheinrichmerker avatar Sep 27 '14 16:09 janheinrichmerker

I worked around it by using HTTP_1.1 which then connected to that server successfully.

hgschmie avatar Sep 27 '14 19:09 hgschmie

Needs documentation.

swankjesse avatar Sep 28 '14 00:09 swankjesse

Hi I am still getting this issue Response{protocol=http/1.0, code=200, message=OK, url=http://} any solution

kunalsharma avatar May 24 '17 06:05 kunalsharma