Saturday, April 5, 2014

Toolcase



Front end: HTML/CSS/JS, Wireframing

Backend: SSJS, DB, Framework, Data Pipelines

APIs: Client-side templating, HTTP, SOA/REST/JSON

URI Uniform Resource Identifier

Is made of the URL (Uniform Resource Locator) and URN (Uniform Resource Name)

Syntax: URI consists of a URI scheme name (such as "HTTP","ftp","mailto","crid","file") followed by a colon character, then a scheme specific part. More at http://en.wikipedia.org/wiki/URI_scheme#Generic_syntax
http://en.wikipedia.org/wiki/URI#Examples_of_URI_references

"http" specifies the 'scheme' name, "en.wikipedia.org" is the 'authority', "/wiki/URI" the 'path' pointing to this article, and "#Examples_of_URI_references" is a 'fragment' pointing to this section.

 REST API:

  • the base URI for the web API, such as http://example.com/resources/
  • the Internet media type of the data supported by the web API. This is often JSON but can be any other valid Internet media type provided that it is a valid hypertext standard.
  • the set of operations supported by the web API using HTTP methods (e.g., GET, PUT, POST, or DELETE).
  • The API must be hypertext driven.[16]
RESTful web API HTTP methods
ResourceGETPUTPOSTDELETE
Collection URI, such as http://example.com/resourcesList the URIs and perhaps other details of the collection's members.Replace the entire collection with another collection.Create a new entry in the collection. The new entry's URI is assigned automatically and is usually returned by the operation.Delete the entire collection.
Element URI, such as http://example.com/resources/item17Retrieve a representation of the addressed member of the collection, expressed in an appropriate Internet media type.Replace the addressed member of the collection, or if it doesn't exist, createit.Not generally used. Treat the addressed member as a collection in its own right andcreate a new entry in it.Delete the addressed member of the collection.
productService.GetProduct("1")
http://someurl/product/1


REST(ful) API is an API that follows the REST architectural style.

REST stands for Representational State Transfer,. Its HTTP version uses the four HTTP methods GET, POST, PUT and DELETE to execute different operations.

A RESTful web service is a web API implemented using HTTP and REST principles. It is a collection of resources, with four defined aspects:

The following table shows how the HTTP methods are typically used to implement a web API.


Where SOAP tries to model the exchange between client and server as calls to objects, REST tries to be faithful to the web domain. So when calling a web service written in SOAP, you may write
in REST, you may call a url with HTTP GET:

No comments:

Post a Comment