Types of HTTP requests are:
- GET: Retrieve data.
- POST: Create new resources.
- DELETE: Delete resources.
- PUT: Update or create resources if they do not exist.
- PATCH: Partially update resources.
- OPTIONS: Check which methods are allowed when querying another domain (preflight request). The browser sends a request with headers:
Access-Control-Request-Method
Origin
If the server allows this origin and method, it returns a response with headers:Access-Control-Allow-Origin
: Allowed origin.Access-Control-Allow-Methods
: Allowed methods. Finally, the requested request is executed.