Examples of JSON parsing / generation and http requests in various languages
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
c Cleanup C example, fixing some potential bugs Jan 9, 2013



Examples of JSON parsing / generation and http requests in various languages

Solutions Explored

Demo code has been written in the following languages:

  1. Javascript
  • jQuery (in Browser, all the hard stuff is handled)
  • NodeJS (Best HTTP and JSON support; server-side)
  1. Ruby
  2. Python
  3. luvit (lua)
  4. C#
  5. Java
  6. curl (exec from any language)
  7. bash
  8. C

However, most of the code we provide is not very robust, so it is in the "untested" branch of this repository. It is provided so the astute programmer can see the basics of normal JSON and HTTP interactions in the language, rather than as a complete, solid application off of which others may build.

Code that is tested and suitable as a starting point is in the master branch. Languages that fall into this category are:

  1. C

Your mileage may vary. Understand the code you are using before actually using it.

ProTip: Use an Application Language (NodeJS, Python, Ruby) to do all of your HTTP / JSON work coupled with some sort of message passing (such as packing a struct) if you need to use a Systems Language (C, Java, C#).

In the future we hope to also have example code in these languages:

  1. GoLang (or Go for short)


The parser you choose MUST be configureable meet the following criteria:

  • IGNORE unexpected and unused fields (new fields will be added in future versions)
  • ACCEPT null as a non-value for any field type


  • when a number is encountered where a string was expected, the number should be treated as a string
  • if an expected field does not exist, it should be treated the same as if the value were null


The eventual goal is to have examples for all of the following in each language:

  • HTTP GET request
  • HTTP POST request
  • JSON parsing (decoding / deserializing)
  • Iterating over objects and arrays
  • JSON stringifying (encoding / serializing)


One day we'll have an SDK...