Giter Club home page Giter Club logo

json-examples's Introduction

json-examples

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)
  2. Ruby
  3. Python
  4. luvit (lua)
  5. C#
  6. Java
  7. curl (exec from any language)
  8. bash
  9. 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)

IMPORTANT

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

Additionally:

  • 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

Examples

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)

SDK

One day we'll have an SDK...

json-examples's People

Contributors

beatgammit avatar ericpeterson avatar jergason avatar jkunkee avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.