JavaScript Node.js Basics Building a Command Line Application Making a GET Request with https

Pedro Esteves
Pedro Esteves
13,125 Points

Status code 406.

When I repeat the steps made by Andrew, I get the statusCode 406. Why? How can I solve this?

Thanks a lot everyone.

Iagor Moraes
Iagor Moraes
18,678 Points

You problably are sending unacepted charset or language to the GET request, above some text of mozila development network:

"The HTTP 406 Not Acceptable client error response code indicates that a response matching the list of acceptable values defined in Accept-Charset and Accept-Language cannot be served."

Pedro Esteves
Pedro Esteves
13,125 Points

Thanks for your answer Iagor. I'm not having the error anymore but I don't really know why. I rewrote the code and now it works.