Загрузка...

Rest API Request and Response Components | Lecture 4

𝐑𝐞𝐬𝐭 𝐀𝐏𝐈 𝐑𝐞𝐪𝐮𝐞𝐬𝐭 𝐚𝐧𝐝 𝐑𝐞𝐬𝐩𝐨𝐧𝐬𝐞 𝐂𝐨𝐦𝐩𝐨𝐧𝐞𝐧𝐭𝐬:

𝐀𝐏𝐈 𝐑𝐞𝐪𝐮𝐞𝐬𝐭: When Client wants to talk to resource on server then Client needs to send the request through API, this request is known as API Request

𝐑𝐞𝐬𝐭 𝐀𝐏𝐈 𝐑𝐞𝐪𝐮𝐞𝐬𝐭 𝐂𝐨𝐦𝐩𝐨𝐧𝐞𝐧𝐭𝐬: API Request comprises of following components

𝟏. 𝐄𝐧𝐝𝐩𝐨𝐢𝐧𝐭: Endpoint is the address to a particular resource on server and each API request is directed to one API endpoint

Example:
https://restful-booker.herokuapp.com/booking

𝟐. 𝐌𝐞𝐭𝐡𝐨𝐝: Method tells which operation we want to perform on the resource

There are many HTTP methods: Get, Post, Put, Patch, Delete etc.

𝟑. 𝐏𝐚𝐫𝐚𝐦𝐞𝐭𝐞𝐫𝐬:
Parameters are variables that are passed in API request for specific instructions

Query Param, Path Param, Body Param

𝟒. 𝐑𝐞𝐪𝐮𝐞𝐬𝐭 𝐇𝐞𝐚𝐝𝐞𝐫𝐬: Key value pair sent with API request to provide additional information about request
Ex: Authorization, Content-Type

𝟓. 𝐑𝐞𝐪𝐮𝐞𝐬𝐭 𝐁𝐨𝐝𝐲: For some operations like Post, Put and Patch, we need to pass request body.

𝐑𝐞𝐬𝐩𝐨𝐧𝐬𝐞 𝐂𝐨𝐦𝐩𝐨𝐧𝐞𝐧𝐭: When we hit any API Request so we get Response from sever and this Response contains multiple components

𝐒𝐭𝐚𝐭𝐮𝐬 𝐂𝐨𝐝𝐞: This indicates the response of Server. It could be success, client side error, server error etc.
Ex: 200, 401 etc.

𝐑𝐞𝐬𝐩𝐨𝐧𝐬𝐞 𝐇𝐞𝐚𝐝𝐞𝐫𝐬:
Similar to Request Headers except these headers provide additional information about Server Response

𝐁𝐨𝐝𝐲: It is the main part which contains actual response. This response will be generally in JSON format

Let us meet in video

Regards
PrinceAutomationDestination

Видео Rest API Request and Response Components | Lecture 4 канала PrinceAutomationDestination
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять