[ 
https://issues.apache.org/jira/browse/THRIFT-2998?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14320675#comment-14320675
 ] 

Traian Stanev commented on THRIFT-2998:
---------------------------------------

I must admit I am out of my depth here. In my case I had to interface with a 
Thrift server, and I had a python client aleady available as resource. The 
Python client worked, while the Node.js client I was working on didn't work at 
all. I traced it down to the Python client setting this header, while the 
Node.js client not doing that, which was causing the server to just answer with 
errors for every request. 

My current workaround is to pass the Content-Type header as a custom header for 
the connection (which is supported already), so it's certainly not a blocking 
issue. 

I was not aware of the correct content types to use -- but what you say does 
sound as the better fix in case those are already supported. I tried using 
those content types against the server I use, and it did not work.

> Node.js: Missing header from http request
> -----------------------------------------
>
>                 Key: THRIFT-2998
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2998
>             Project: Thrift
>          Issue Type: Bug
>          Components: Node.js - Library
>    Affects Versions: 0.9.2
>            Reporter: Traian Stanev
>
> The "Content-Type" header is not being set to "application/x-thrift" when 
> making http requests in the node.js implementation. This results in error 
> response (status 400) for any such connections (depending on whether the 
> server checks the header). The Python implementation for example adds the 
> header explicitly:
> https://github.com/tstanev/thrift/blob/master/lib/py/src/transport/THttpClient.py#L127



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to