1/12
Looks like no tags are added yet.
What is an API
Application Programming Interface - A defined way for different software systems to communicate between each other
What is REST
Rest is a defined set of rules/conventions that is commonly used with APIs
What are the main HTTP methods and what do they do
GET - retrieve data
POST - Add a new entry to the data
PUT - update and replace existing data
PATCH - update existing data, but only specific fields
DELETE - delete an entry from the Data
What are the three main categories of Status Codes and what do they mean
2XX - some type of success
4XX - some type of user-related failure
5XX - some type of server-related failure
What is an API Endpoint
We have a server that the API is hosted on. The endpoint is the specific path on that server which contains whatever data it is you’re looking for
What does Uniform Interface mean for REST
All the different methods and way to access the resources are organized and predictable
What does client-server separation mean for REST
The server and client don’t need to have any sort of communication. As long as the API handshake is established these two components can be scaled and changed as two seperate entities
State in REST
Requests have no state and must be self-contained/sufficient
What is a gateway
A gateway is used whenever you have microservices. When you want to use one API, but execute its functionality across multiple servers a gateway is used to route.
4 Authentication methods for APIs and how they work
HTTP Basic - send the username and password within the request. Not often used
Bearer Tokens - have the user login within the application, or do something else to gain authorization. They now have a token, normally with some type of limited lifespan. This token is attached to their requests
API Keys - Unlike a token, these are normally going to be tied to an application. These are also normally longer lived, and track things like usage which helps enforce limits
OAuth2.0 - Instead of having the user login and the backend provide a token, allow the user to log into a third party system, which will provide the token instead.
What does CORS do
CORS allows a backend to enforce what different origins are allowed to read its responses. This is done out of security
Elements of an HTTP request
Method, endpoint, request version, host
Elements of an HTTP response
request version, status code, metadata (like content type), the actual data