19. FAQ 2 - REST API for beginners

19. FAQ 2 - REST API for beginners

What is REST?

REST (Representational State Transfer) is a style in software architecture which is applied to web APIs by developers.

What is RESTful API?

RESTful API is an implementation of a REST architecture that uses HTTP requests.

How does it work?

First RESTfull API sends an HTTP request to a server by HTTP methods (GET, POST, PUT, and DELETE).

Second, the server responds as JSON (JavaScript Object Notation) or XML (eXtensible Markup Language).

REST or RESTful API?

REST are architecture principles and RESTful is API that follows these principles.

What is URI?

Each request includes a URI (Uniform Resource Identifier). URI is used to identify which resource is being accessed, as well as any parameters or data needed to complete the request. The server processes the request and sends back a response.

How do we test RESTful API?

  • Manual testing: This involves manually sending HTTP requests to the API using tools such as cURL or Postman and then manually analyzing the response.

  • Automated testing: This involves using a testing framework or library to programmatically send requests to the API and check the responses. Usually, it is done by using tools such as JUnit, TestNG, or REST-assured.

Resources