Help, Parse Error: Content-Length can't be present with Transfer-Encoding #1576
-
I am trying to do a GET request onto 'http://mc.xeno-world.com:25666/v1/graph?server=XenoWorld&type=serverCalendar', but I keep getting the error in title... I know it has smt to do with the headers, but I honestly have no clue how to make it so that it doesnt break apart. I have tried doing the exact same request in the insomnia client, and while it does take it's time, it does respond after about 5 seconds. What Im doing:
I also get this output along with the usual node traceback:
so if thats helpful :D |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
The problems is with the server, its behavior is out of spec. It sends Take a look at https://tools.ietf.org/html/rfc2616#section-4.4 for more info. |
Beta Was this translation helpful? Give feedback.
-
The spec at https://datatracker.ietf.org/doc/html/rfc2616#section-4.4 specifically states that the client should ignore the content-length, not explode... 3.If a Content-Length header field (section 14.13) is present, its |
Beta Was this translation helpful? Give feedback.
-
The RFC above is a bit out of date. See https://datatracker.ietf.org/doc/html/rfc7230#section-3.3.2
It doesn't say anything about ignoring the header. |
Beta Was this translation helpful? Give feedback.
The problems is with the server, its behavior is out of spec.
It sends
Transfer-encoding: chunked
andContent-length: ####
.Take a look at https://tools.ietf.org/html/rfc2616#section-4.4 for more info.