http api code example

Example 1: rest api

Representational state transfer is a software architectural style that defines
a set of constraints to be used for creating Web services.

Web services that conform to the REST architectural style, called RESTful Web
services, provide interoperability between computer systems on the internet

Example 2: api response

Response 
				
				 Status code 
				 			2xx -->>  success 
				 			4xx -->>  client side error
				 			5xx -->>  server side error 
				 Header 
				 		meta data about your response 
				 		like Content-Type, Date and some other info

				 Body | Payload		
				 		The response we got from the server 
				 		and this where we do lots of validation