Looking for a Tutor Near You?

Post Learning Requirement »
x

Choose Country Code

x

Direction

x

Ask a Question

x

x
x
x
Hire a Tutor

Notes On RESTful API

Loading...

ARESTful API(RESTfulwebservice), is based on Representational State Transfer(REST) technology, which is an architectural style and approach to communications often used in web services development.

Prantik S / Kolkata

11 years of teaching experience

Qualification: MCA (Jaipur National University - [JNU], Jaipur - 2017)

Teaches: Basic Computer, Computer for official job, MS Office, School Level Computer, ICT Training, Computer Science, Information Practice, IT & Computer Subjects, BCA Tuition, IT, Computer, C / C++, C# (C Sharp), Java And J2EE, Python Programming, Visual Basic, BCA Subjects, Hardware Training, Networking, Java Script

Contact this Tutor
  1. What is RESTful API? A REST ful API (REST ful web service), is based on Representational State Transfer (REST) technology, which is an architectural style and approach to communications often used in web services development. REST ful API is mostly used for HTTP web APIs where there is no need for any additional libraries or packages to be installed. REST itself is very flexible. There are not many limitations, but developers refer to best practices when architecting a REST API. REST has the ability to handle multiple types of requests and return different types of data (such as JSON and XML). For example, a GET request to the following Facebook Graph API endpoint responds with the user information. https://graph.facebook.com/v3.0/{user-id} As another example, Google Geocoding API request takes the following form: https://maps.googleapis.com/maps/api/geocode/json It is important to design an intuitive and convenient API. Requests to API URLs are made using one of the I-IT TP methods, such as GET, POST, PUT or DELETE. Note: Roy Thomas Fielding is an American computer scientist, who defined the REST API Design in his 2000 doctorate dissertation. REST Architectural Constraint REST (Representational State Transfer) advocates that web applications should use HTTP as it was originally envisioned. Lookups should use GET requests. PUT, POST, and DELETE requests should be used for mutation, creation, and deletion respectively. REST allows independent evolution of the application without having the application's services, models, or actions tightly coupled to the API layer itself.
  2. This uniform interface should provide an unchanging, standardized means of communicating between the client and the server, such as using HTTP with URI resources, CRUD (Create, Read, Update, Delete), and JSON. While designing REST API, try to make all client-server interaction stateless. The server shouldn't store anything about latest HTTP request client made. It should treat every request as new. If the client app needs to keep states for an end user, then each request should contain all the information necessary to service the request (including authentication and authorization details). Note: Because a stateless API can increase request overhead by handling large loads of incoming and outbound calls, a REST API should be designed to encourage the storage of cacheable data. What is HTTP? Hypertext Transfer Protocol (HTTP) is an application layer protocol for transmitting hypermedia documents. By default, HTTP follows the classic client-server model, where the client opens a connection to make a request and then waits for the server's response. Internet Clients Server You probably encountered HTTP Status Response Codes such as 404 (Not Found) or 500 (Internal Server Error).
  3. I-IT TP Headers HTTP headers are important parts of HTTP messages, passing along additional information along with the message body. An HTTP header consists of a name followed by a colon then by its value. The name is case- insensitive. In the example below, "Content-Type" is the name of the header and its value is "image/png" Content-Type: image/png There are no line breaks between the header name and value. Typically, when working with websites, two types of headers are sent: Request and Response. Request headers consist of data about what the client wants to receive and about the client itself. Response headers provide more information about the resource being sent, including information such as the server name, location, version, etc. For example, a request header may look like this: GET /file.html HTTP/version Host: HostName From: NameOfRequestingUser Cache-Control: no-cache The start line describes the message, meaning the server should respond to a GET request for the resource /file.html. Host, From and Cache-Control are sample headers. Note: There are more than 60 default header names and you can create any custom header by using alphabetical or numerical characters.