Learn HTTP/REST APIs by visualizing requests, responses, status codes, and data flow. See exactly what happens when you make an API call.
Visualize HTTP requests and responses with different methods
🌐 REST API Simulator - Send requests and watch the complete request/response flow! Try different HTTP methods and endpoints to see how REST APIs work.
1// Making HTTP requests with fetch API2 3// GET - Retrieve data4fetch('https://api.example.com/users')5 .then(response => response.json())6 .then(data => console.log(data));7 8// POST - Create new resource9fetch('https://api.example.com/users', {10 method: 'POST',11 headers: {12 'Content-Type': 'application/json',13 },14 body: JSON.stringify({15 name: 'Alice',16 email: 'alice@example.com'17 })18})19 .then(response => response.json())20 .then(data => console.log(data));21 22// PUT - Replace entire resource23fetch('https://api.example.com/users/1', {24 method: 'PUT',25 headers: {26 'Content-Type': 'application/json',27 },28 body: JSON.stringify({29 name: 'Alice Updated',30 email: 'alice@example.com'31 })32});33 34// DELETE - Remove resource35fetch('https://api.example.com/users/1', {36 method: 'DELETE'37});REST (Representational State Transfer) is an architectural style for APIs. HTTP Methods (CRUD operations): - **GET**: Read/retrieve data (safe, idempotent) - **POST**: Create new resources (not idempotent) - **PUT**: Replace entire resource (idempotent) - **PATCH**: Update parts of resource (not idempotent) - **DELETE**: Remove resource (idempotent) Status Codes: - **2xx**: Success (200 OK, 201 Created) - **3xx**: Redirection (301 Moved, 304 Not Modified) - **4xx**: Client errors (400 Bad Request, 404 Not Found) - **5xx**: Server errors (500 Internal Error, 503 Unavailable)
Application Programming Interface - a way for applications to communicate with each other. REST APIs use HTTP to send requests and receive responses.
Client sends a request (method, URL, headers, body). Server processes it and returns a response (status code, headers, data). Simple as that!
REST is stateless, scalable, and uses standard HTTP. It's the most common API architecture for web services. Easy to understand and implement.