Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
i just use and PUT Api call with postman with the parameter body = none and it works.
I create a job in talend Open Studio for Data Integration (8.0.1.20211109_1610) and the component tRestClient return me this error , even if in the Advanced Settings we Disable chucked encoding. We tried also to put Content-Length = 0 or = "0" but we get the same error.
statusCode body string
411|<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>Length Required</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY><h2>Length Required</h2>
<hr><p>HTTP Error 411. The request must be chunked or have a content length.</p>
</BODY></HTML>
Hi, I tried it in the first place.
I had to switch to tJavaRow with some issue as well that i solved luckily.
EDIT: still looking for an answer. There are other post like mine with the same problem more or less unsolved.
EDIT: Reused trest component and it worked. I put more parameter using also the hidden ones on POST-MAN. I inserted a random body that means nothing.
Hi @Enrico Guarato , so have you try to set the same parameter : body = none in tRestClient ?
no, because you can't do that.
Have you try to use the same header than your postman call ?
Hi Jeremy. I'm using the exactly same call i made in postman. I used also fiddler to check if there was other hidden parameters.
GET and POST works fine.
Could you try to use the tRest component instead of tRestClient component ?
Hi, I tried it in the first place.
I had to switch to tJavaRow with some issue as well that i solved luckily.
EDIT: still looking for an answer. There are other post like mine with the same problem more or less unsolved.
EDIT: Reused trest component and it worked. I put more parameter using also the hidden ones on POST-MAN. I inserted a random body that means nothing.
We were getting these 411 errors for one of our API endpoints as well. Initially we researched potentially sending a content-length header, and while double-checking the format, MDN provided some interesting insight:
From MDN:
The HTTP Content-Length header indicates the size, in bytes, of the message body sent to the recipient.
Content-Length is limited in that the message size must be known up front, before sending the headers, which is a problem when content is dynamically generated or streamed.
Transfer-Encoding: chunked for responses sent out in parts as its size is calculated.Content-Length is redundant, because the content length may be inferred from DATA frames. It may still be included for backwards compatibility.Full article:
Content-Length header - HTTP | MDN
In our case, we were able to go into the Advanced settings of the tRestClient component and enable the 'Force HTTP 1.1' option, then leave the chunked encoding active (i.e. leave the 'Disable Chunked Encoding' unchecked), which seems to have made the tRestClient behave as described in the second bullet point above, and we no longer recieved the 411 error.