One Star

[resolved] Http Headers not getting set in TRESTClient Put method call

Hello,
I am trying to set the headers for a put method call through tRESTClient but i am getting the same error message of
"errors":,"message":"Expecting Accept=application/vnd.mediaocean.mdm-v1+json"}]}
Attaching the screen shots here.
              


Here the request shows accept header as the value that i have set, but the response code shows content-type with that value.
Also, the PREAUTH_USER_ID header doesnt get passed at all in the response.
how can this be rectified? somewhere during the request sent to the tRESTClient, the content-type is getting overridden with the Accept header value! Is there a workaround for this?
Please help me with this issue.
I am stuck on this for too long.
Any help will be appreciated.
Thank you.
1 ACCEPTED SOLUTION

Accepted Solutions
Employee

Re: [resolved] Http Headers not getting set in TRESTClient Put method call

Hi
I can see tRESTClient actually producing a correct set of headers, including your custom header. Accept header is not optimal, it has 3 values, a wildcard and your content type (Accept with multiple values is valid), but unfortunately the server is not able to accept such a header, even though your custom media type has an obvious precedence over a wildcard.
The problem is that tRESTClient accumulates Accept header values, which is generally OK. In your case you have Accept set to 'any' and also set in the advanced properties, perhaps we should support the overriding mode.
See https://jira.talendforge.org/browse/TESB-10554
Cheers, Sergey
1 REPLY
Employee

Re: [resolved] Http Headers not getting set in TRESTClient Put method call

Hi
I can see tRESTClient actually producing a correct set of headers, including your custom header. Accept header is not optimal, it has 3 values, a wildcard and your content type (Accept with multiple values is valid), but unfortunately the server is not able to accept such a header, even though your custom media type has an obvious precedence over a wildcard.
The problem is that tRESTClient accumulates Accept header values, which is generally OK. In your case you have Accept set to 'any' and also set in the advanced properties, perhaps we should support the overriding mode.
See https://jira.talendforge.org/browse/TESB-10554
Cheers, Sergey