question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

specified encoding unsupported

See original GitHub issue

Hi, I’m a beginner with nodejs/expressjs and try to run a POST request with body-parser middleware as:

app.use(bodyParser.json({
    inflate: true
}));
app.use(bodyParser.urlencoded({ extended: true, inflate: true }));

but get the error: “specified encoding unsupported”.

the response headers: Connection →keep-alive Content-Length →176 Content-Type →application/json; charset=utf-8 Date →Thu, 06 Oct 2016 06:58:56 GMT X-Powered-By →Express

any idea what had I missed?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
dougwilsoncommented, Mar 28, 2017

Hi @greyd we do support allowing the charset to be set in the content-type header, but the header you posted above is actually invalid per the HTTP RFC, you need to remove that trailing ; character, as it signals the start of a new parameter, but since none follows, the assumption is that the header has been truncated.

0reactions
greydcommented, Mar 28, 2017

@dougwilson That works. I never thought that this semicolon could be a problem. Thanks for the explanation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

415 Unsupported Media Type - Unsupported Encoding
This error occurs if the value of the Content-Encoding header specified either in the HTTP request sent by the client to Apigee or...
Read more >
unsupported encoding: UTF-8 - Stack Overflow
You actually specify encoding="UTF-8 " . Note the trailing space. Remove that space, by changing it to encoding="UTF-8" .
Read more >
415 Unsupported Media Type - HTTP - MDN Web Docs
The HTTP 415 Unsupported Media Type client error response code indicates that the server refuses to accept the request because the payload ...
Read more >
java.io.UnsupportedEncodingException in Java with Examples
The java.io.UnsupportedEncodingException occurs when an unsupported character encoding scheme is used in java strings or bytes.
Read more >
TO_BYTES() fails with "9134 Unsupported ENCODING type ...
TO_BYTES() fails with "9134 Unsupported ENCODING type" though valid ENCODING specified Sample SQL: select 'Markus' , char2hexint('Markus') ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found