GoConqr has a new look! Let us know what you think.

Notes

What is a RestfulAPI?

bikram patnaik Learning Technology English 1 page

What is a RestfulAPI?

Content of the notes (1)

Page 1

What is a RestfulAPI?

What is a RestfulAPI?

You can see from this scenario that there are:

Roles,

Verb ( Ask, Receive ),

Result

And they all play a drama called the ”Restful API”.

- So, the Restful API is the Representation State Transfer—it’s about the architectural style.

- There’s no standard on how you build your restful API (like, if you write a drama, there should be no standard pattern, right?).

- Instead, it’s all about the action between Browser | Server, and how you communicate with the object you want.

So, RestfulAPI is this entire picture: Browser| Web Server, action by method: GET, POST, PUT, DELETE and so on, and a Browser that will react with the result to the web page.

We primarily use http to connect both Browser| Web Server. So, now let’s look at what an http request is.

What is an http request? With an http request, you can send the specific request and get the specific product you want directly, or you can send the common request and retrieve one of the products in the whole list.

You can look at it this way:Nouns: Like whole collections of books, or resources, in http, this can be a URL such as http://book.com/books/{list}.

Verbs: This is the action involving our bookshelf. So, you can get the book, remove the book… and in http, you can use GET, POST, PUT, DELETE.

Content types: The book information is the author names, editor, publishing date, and so on. So, in http, you show this information with XML, JSON.

Example:

So if I want book 1, the URL to get book 1 can be

http: //book.com/books/1.

If I want the author information, such as the publish date from book 1, the URL can be

http: //book.com/books/1?authorInfo=John&publishDate=2016.

In JSON format, it looks like this:

What is a RestfulAPI?

So, the action should return the status, right?

http has a status code to show the return status:

200: ok

404: Not Found

500: internal Server Error

Information

Description
Learning Technology Note on What is a RestfulAPI?, created by bikram patnaik on 16/03/2017.
Created by
bikram patnaik
Views
0
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?