Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Differences between REST and JSON APIs

Wondering what the differences between REST and JSON APIs are, how you interface with them, and how to go about parsing the results. My goal is to build a small application for my android phone to tell me when the next train will get to the subway station by my house, using the developer API provided by the transit agency.

I'm learning C++ in university, but hope to go about this in Java. I'm sorry if this is more of a discussion question rather than a black and white answer question, but I can't find any information elsewhere.

APIs in Question

like image 692
Mike Avatar asked Nov 10 '10 03:11

Mike


People also ask

Are all REST API JSON?

REST APIs should accept JSON for request payload and also send responses to JSON. JSON is the standard for transferring data. Almost every networked technology can use it: JavaScript has built-in methods to encode and decode JSON either through the Fetch API or another HTTP client.

Is REST API just JSON?

REST is designed to be simple. The gist of it is that each url corresponds to a unique resource. The format of the resource is commonly json, but can be anything, and is typically determined by the "extension" or "format" part of the url.

Is REST always JSON?

For some, REST means a server that exchanges JSON documents with a client over HTTP. Not only is that not a complete definition, but it's also not always true. The REST specification doesn't require HTTP or JSON.

What is the relation between API and JSON?

How JSON API Works. The user and the server send a data request in the API. The API then designates how the data will be called using the GET method and the affiliated links shared. A JSON object then retrieves data and outputs either an error message or shows data depending on the user request.


1 Answers

Very first thing to mention, JSON is not an API but a data format webservices and programs use to communicate to each other.

Webservices can be of many forms but most popular are REST and SOAP. Webservices give you a way to interact with remote machines and communicate with them.

To read more about Json, visit http://www.json.org/ , http://en.wikipedia.org/wiki/Json

And to read more about Webservices, visit, http://en.wikipedia.org/wiki/Webservices

like image 122
itsaboutcode Avatar answered Oct 12 '22 13:10

itsaboutcode