[
https://issues.apache.org/jira/browse/THRIFT-3876?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15380767#comment-15380767
]
ASF GitHub Bot commented on THRIFT-3876:
----------------------------------------
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
> haxe js/nodejs client
> ---------------------
>
> Key: THRIFT-3876
> URL: https://issues.apache.org/jira/browse/THRIFT-3876
> Project: Thrift
> Issue Type: Improvement
> Components: Haxe - Library
> Reporter: Oleksii Prudkyi
> Assignee: Oleksii Prudkyi
>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)