Github user oprudkyi commented on a diff in the pull request:

    https://github.com/apache/thrift/pull/1045#discussion_r71066333
  
    --- Diff: lib/haxe/src/org/apache/thrift/transport/THttpClient.hx ---
    @@ -39,12 +46,25 @@ class THttpClient extends TTransport {
         private var requestBuffer_  : BytesOutput = new BytesOutput();
         private var responseBuffer_ : BytesInput = null;
     
    +    #if !js
         private var request_        : Http = null;
    +    #else
    +    private var request_        : JsHttp = null;
    +    #end
     
     
         public function new( requestUrl : String) : Void {
    -          request_ = new Http(requestUrl);
    -        request_.addHeader( "contentType", "application/x-thrift");
    +        #if !js
    +        request_ = new Http(requestUrl);
    +        #else
    +        request_ = new JsHttp(requestUrl);
    +        request_.async = false;
    +        #end
    +        request_.addHeader("Content-Type", "application/x-thrift");
    +        request_.addHeader("Accept", "application/x-thrift");
    --- End diff --
    
    how code in the transport will get info what is content type used 
(binary/json/compact) ?
    right now I see only analysis of data stream might help (ie check first 
byte, etc) but this is very ugly 
    real implementation will include some TTransport.setContentType() function 
which should be called by every  TProtocol implementation , in all languages 



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to