Skip to main content
Announcements
A fresh, new look for the Data Integration & Quality forums and navigation! Read more about what's changed.
cancel
Showing results for 
Search instead for 
Did you mean: 
Nadrel
Contributor

HTTP Error 411 - The request must be chunked or have a content length with tHttpRequest

Hi everyone,

I'm trying to send a JSON file via POST using a tHttpRequest, but every time I get an HTTP Error 411 (Studio 7.3).

I tried adding a Content-Length header, but it didn't work.

Everything works fine when I send the JSON file using Talend API Tester, and I don't even need to set the Content-Length header.

I'm pretty sure I'm doing something wrong, but I can't figure out what it is.

Here are some screenshots of the error, along with how I get the Authorization and Content-Length headers, and how I set my tHttpRequest:

HTTP Error 411HTTP Error 411

AuthorizationAuthorization

Calculate the Content-LengthCalculate the Content-Length

tHttpRequesttHttpRequest

In the hope that someone can help me, I wish you all a great day.

Labels (2)
1 Solution

Accepted Solutions
Nadrel
Contributor
Author

By reading this topic in detail, I decided to try using the tRest component instead of tHttpRequest.

I added my headers (Content-Type, Content-Length, and Authorization), included the body, and it seems to work.

I still don’t know why tHttpRequest kept giving me an Error Code 411, even though there was a Content-Length header, but I'm going to use tRest from now on (https://help.qlik.com/talend/fr-FR/components/7.3/rest/trest).

I wish you all a good day.

View solution in original post

1 Reply
Nadrel
Contributor
Author

By reading this topic in detail, I decided to try using the tRest component instead of tHttpRequest.

I added my headers (Content-Type, Content-Length, and Authorization), included the body, and it seems to work.

I still don’t know why tHttpRequest kept giving me an Error Code 411, even though there was a Content-Length header, but I'm going to use tRest from now on (https://help.qlik.com/talend/fr-FR/components/7.3/rest/trest).

I wish you all a good day.