Getting Started Tip - Making a call to a Thriftly.io API


#1

One of our goals with Thriftly.io is to make it as simple as possible for as many developers as possible to call Thriftly.io based APIs. In that vein, we’ve included support for JSON-RPC (similar to REST), SOAP, and Apache Thrift. All of these can be called over an HTTP connection and you don’t even have to decide upfront which protocol you want your API served through!

Thriftly.io allows for any protocol to be requested on any API just by setting an HTTP header. So for instance, if you want to make a SOAP call to a Thriftly.io based API, you just need add this request header:

Server-Protocol: SOAP

If you’re making a call from a mobile application and want to use as little data as possible, Apache Thrift is your best bet:

Server-Protocol: Thrift-Binary

This request header also tells us what format to expect the request parameters to arrive in. So for instance, if you were to pass SOAP in the Server-Protocol header, Thriftly.io would expect the body of your request to contain a standard SOAP request.

When you setup a deployed application, you can choose the default protocol which will be assumed is this header is not passed.