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

James E. King, III commented on THRIFT-3250:
--------------------------------------------

Is there a way to do this that's backwards compatible?  For example the client 
always initiates a request and it can indicate it accepts a list of response 
types.  Right now {{THttpClient.java}} has:
{noformat}
      post.setHeader("Accept", "application/x-thrift");
{noformat}

If this was changed to allow application/vnd.apache.thrift.*, then the server 
side could look at the "Accept" field and if the client accepts it, it can use 
one of the new fields; or for a poorly written older client that does not use 
the Accept header at all, it would default to current behavior.

> Apache Thrift should use registered media types with HTTP
> ---------------------------------------------------------
>
>                 Key: THRIFT-3250
>                 URL: https://issues.apache.org/jira/browse/THRIFT-3250
>             Project: Thrift
>          Issue Type: Improvement
>          Components: .NETCore - Library, AS3 - Library, C# - Library, C++ - 
> Library, Cocoa - Library, D - Library, Dart - Library, Delphi - Library, 
> Erlang - Library, Go - Library, Haskell - Library, Haxe - Library, Java - 
> Library, JavaME - Library, JavaScript - Library, Node.js - Library, Perl - 
> Library, PHP - Library, Python - Library, Ruby - Library
>    Affects Versions: 0.9.3
>         Environment: all
>            Reporter: Randy Abernethy
>            Assignee: Randy Abernethy
>            Priority: Minor
>
> Now that we have registered media types:
> - application/vnd.apache.thrift.binary
> - application/vnd.apache.thrift.compact
> - application/vnd.apache.thrift.json
> We should use them exclusively, replacing the old x-thrift. I suggest 
> TProtocol gain a getMediaType() method which returns the correct media type 
> when invoked on a concrete protocol (e.g. TBinaryProtocol.getMediaType() 
> would return "application/vnd.apache.thrift.binary".
> HTTP oriented code can then invoke the getMediaType() method of the protocol 
> to discover the correct media type to set in HTTP headers. 
> Thoughts?



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to