Dies ist eine alte Version des Dokuments!
LU11a - CRUD and HTTP Methods - Under Construction
Source: W3Schools | HTTP Methods
Learning Objectives
- Describe the four module relevant HTTP Methods - Explain at least three differnences between the POST and GET method - Asign each of the CRUD operations to one of the four main http request methods
Introcuction
HTTP (Hypertext Transfer Protocol) methods are fundamental to the communication between clients (like web browsers) and servers in web applications. They allow the client to perform various operations on the server, such as retrieving, creating, updating, or deleting resources. The most commonly used HTTP methods are POST, GET, PUT, and DELETE. Each has a specific purpose and behavior in how it interacts with the server.
During this module (290) we are going to use 4 of them. Let’s dive into each method and see practical examples of how they are used.
1. GET - Retrieving Data
The GET method is used to retrieve data from the server. It requests a resource without altering the data on the server. Since it does not modify data, it is considered a „safe“ and „idempotent“ operation (multiple identical GET requests will produce the same result).
Practical Example: Imagine a website displaying a list of products. To retrieve the list of products from a server, the client would use a GET request.
Request:
http GET /products
Example URL:
https://api.example.com/products
This would fetch the list of products from the server and display them to the user.