KEMBAR78
REST API and CRUD | PDF
REST API AND
CRUD
WHAT IS A REST API?
• REST stands for Representational State Transfer.
• It is a lighter weight alternative to SOAP and WSDL XML-based
API protocols.
• REST uses a client-server model, where the server is an HTTP
server and the client sends HTTP verbs (GET, POST, PUT, DELETE),
along with a URL and variable parameters that are URL-encoded.
• The URL describes the object to act upon and the server replies
with a result code and valid JavaScript Object Notation (JSON).
WHAT MODEL DOES REST USE?
REST:HTTP METHODS?
Some of the common HTTP result codes that are often used inside REST APIs are
as follows:
• 200 - “OK”.
• 201 - “Created” (Used with POST).
• 400 - “Bad Request” (Perhaps missing required parameters).
• 401 - “Unauthorized” (Missing authentication parameters).
• 403 - “Forbidden” (You were authenticated but lacking required privileges).
• 404 - “Not Found”.
HTTP CODES
WHY REST API?
• Developing a REST API enables us to create a foundation upon which
we can build all other applications.
• As previously mentioned, these applications may be web-based or
designed for specific platforms, such as Android or iOS.
• A REST API also makes it easy to implement other interfaces or
applications over time, turning the initial project from a single.
application into a powerful platform.
The CRUD acronym is often used to describe database operations.
CRUD stands for CREATE, READ, UPDATE, and DELETE.
WHAT IS A CRUD?
These operations map very nicely to the HTTP verbs, as follows:
• POST: A client wants to insert or create an object.
• GET: A client wants to read an object.
• PUT: A client wants to update an object.
• DELETE: A client wants to delete an object.
CRUD OPERATION
CRUD APPLICATION EXAMPLE

REST API and CRUD

  • 1.
  • 2.
    WHAT IS AREST API? • REST stands for Representational State Transfer. • It is a lighter weight alternative to SOAP and WSDL XML-based API protocols.
  • 3.
    • REST usesa client-server model, where the server is an HTTP server and the client sends HTTP verbs (GET, POST, PUT, DELETE), along with a URL and variable parameters that are URL-encoded. • The URL describes the object to act upon and the server replies with a result code and valid JavaScript Object Notation (JSON). WHAT MODEL DOES REST USE?
  • 4.
  • 5.
    Some of thecommon HTTP result codes that are often used inside REST APIs are as follows: • 200 - “OK”. • 201 - “Created” (Used with POST). • 400 - “Bad Request” (Perhaps missing required parameters). • 401 - “Unauthorized” (Missing authentication parameters). • 403 - “Forbidden” (You were authenticated but lacking required privileges). • 404 - “Not Found”. HTTP CODES
  • 6.
    WHY REST API? •Developing a REST API enables us to create a foundation upon which we can build all other applications. • As previously mentioned, these applications may be web-based or designed for specific platforms, such as Android or iOS. • A REST API also makes it easy to implement other interfaces or applications over time, turning the initial project from a single. application into a powerful platform.
  • 7.
    The CRUD acronymis often used to describe database operations. CRUD stands for CREATE, READ, UPDATE, and DELETE. WHAT IS A CRUD?
  • 8.
    These operations mapvery nicely to the HTTP verbs, as follows: • POST: A client wants to insert or create an object. • GET: A client wants to read an object. • PUT: A client wants to update an object. • DELETE: A client wants to delete an object. CRUD OPERATION
  • 9.