What’s the meaning of error 406?

Asked

Viewed 9,043 times

7

Not Acceptable

An appropriate representation of the requested Resource /aa/bb/cc.php could not be found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an Errordocument to Handle the request.

Receiving this error, which sends?

I understand that the page is denying access to resources, but what could be the reasons for this to run?

2 answers

7


Is a problem of content type. Probably the request or response is using a mime-type that the server or client cannot handle. It can also be a charset or encoding invalid. It may still be an invalid language or the size of the resource. Probably one of the two sides is set wrong. Most likely you are receiving this from a specific client who is not sending the request correctly.

As there are no details, you can only answer generically.

  • was sending the request through the following format: http://www.dominio.com.br/subdominio/arquivo.php, I changed it to 406 http://www.subdominio.dominio.com.br/arquivo.php And it worked, is there an explanation? I can normally access the file the first way, but when trying to send a request with Curl the first way it doesn’t seem to work, only in the previous format( and in fact, it is a domain that is hosted the file).

  • Only with this information is difficult to explain. But it is common to give this type of error used a client that is not a browser. The programmer always forgets to do something.

  • 1

    To add in order to help future queries, I added the following line and helped me resolve as well, curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);

  • 1

    Makes sense....

0

I had the same problem but with the HTTP 406 error in a request with Curl in the PHP language, I was able to solve by adding the CURLOPT_USERAGENT.

curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);

Browser other questions tagged

You are not signed in. Login or sign up in order to post.