close

[Solved] How to force CURL to ask for http/1.1? Or maybe there’s another issue, not sure

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error How to force CURL to ask for http/1.1? Or maybe there’s another issue, not sure in php. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How to force CURL to ask for http/1.1? Or maybe there’s another issue, not sure Error Occurs?

Today I get the following error How to force CURL to ask for http/1.1? Or maybe there’s another issue, not sure in php.

How To Solve force CURL to ask for http/1.1? Or maybe there’s another issue, not sure Error ?

  1. How To Solve force CURL to ask for http/1.1? Or maybe there's another issue, not sure Error ?

    To Solve force CURL to ask for http/1.1? Or maybe there's another issue, not sure Error Anyway, when I replaced all those Httpful calls prior to the request in question with low level ones, everything worked fine.

  2. To Solve force CURL to ask for http/1.1? Or maybe there's another issue, not sure Error

Solution 1

Error 505: HTTP Version Not Supported is not an error string that is returned by curl/libcurl, that sounds like content that you receive from the server you’re communicating with. If you would show us the full HTTP response including headers, we could probably have seen that.

So, all your playing around with different curl options was to no gain because curl worked fine every single time. You could also verify that with using the curl command line tool against the host you’re trying to get to work:

curl https://android.clients.google.com/auth -v --http1.1 -X POST --no-alpn --no-npn

This command line shows that both the TLS and HTTP “layers” are fine.

Another question here got a similar error when they passed in the wrong data (not url encoded). Maybe you have something similar and because of your switch to a new framework you missed it?

Solution 2

Okay, I figured it out.

Actually, BEFORE that piece of code in Code B there was another request executed using yet another library (Httpful, to be exact) and it seems that request messed things up somehow. I did not know that something can affect a request performed with a clean curl_init().

Anyway, when I replaced all those Httpful calls prior to the request in question with low level ones, everything worked fine.

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read

Leave a Comment