http

Showing posts with label http. Show all posts
Showing posts with label http. Show all posts

What is REST


REST

Introduction

  • Stands for Representational State Transfer.
  • REST is a web standards-based architecture that uses the HTTP protocol (port 80) for data communication.
  • Uses HTTP methods for data communication 
  • REST server simply provides access to resources and client access and presents the resource.
  • REST is stateless, so there is no session.
  • REST uses various representations like TXT, JSON, XML...etc to represent resources.

Methods in REST

  • POST
    • Sends data to the server for creating a new resource, maybe an entity. Often used when uploading a file or submitting a web form.
  • GET 
    • Retrieves data from the server. Should have no other effect.
  • PUT 
    • Similar to POST, but used to replace an existing entity.
  • PATCH
    • Similar to PUT, but used to update only certain fields within an existing entity.
  • DELETE 
    • Removes data from the server.
  • TRACE 
    • Provides a way to test what the server receives. It simply returns what was sent.
  • OPTIONS 
    • This allows a client to get information about the request methods supported by a service. 
    • The relevant response header is Allow with supported methods.
  • HEAD 
    • This returns only the response headers.
  • CONNECT 
    • Used by browser when it knows it talks to a proxy and the final URI begins with https://. 
    • The intent of CONNECT is to allow end-to-end encrypted TLS sessions, so the data is unreadable to a proxy.