
Module 6 Lesson 1: Professional API Requests
Master the HTTP Request node. Learn how to handle different request methods (GET, POST, PUT, DELETE), custom headers, and query parameters for any API.
Module 6 Lesson 1: Professional API Requests
While native nodes are great, a pro n8n user spends a lot of time in the HTTP Request node. This is the "Skeleton Key" that unlocks every digital service on the internet.
1. The Verb Palette (GET vs POST)
- GET: "Give me information." (e.g., Get weather, Get user profile).
- POST: "I am creating something new." (e.g., Submit form, Send message).
- PUT/PATCH: "I am updating something."
- DELETE: "Remove this data."
2. Query Parameters vs Body
- Query Parameters: In the URL (
?id=123). Best for filtering a GET request. - Body: In the "Hidden payload." (JSON). Best for sending complex data (like a new user's address and photo).
3. Handling Custom Headers
Many APIs require specific headers for security or formatting:
Content-Type: application/jsonAccept: application/vnd.github.v3+jsonX-My-Custom-Header: secret-version
4. The "Import from cURL" Feature
If a website's documentation gives you a command like curl -X POST https://api.com..., don't type it manually.
- In n8n, click the "Import from cURL" button in the HTTP Request node settings.
- Paste the command. n8n will automatically setup the URL, headers, and body for you!
Exercise: The API Detective
- Go to JSONPlaceholder.
- Use the HTTP Request node to "POST" a new post to
/posts. - Include a JSON body with
title,body, anduserId. - What "Status Code" did the node return? (Hint: 201 means "Created").
- Try to "DELETE" post #1. Did it work?
- Research: What is "Binary Body" mode in the HTTP Request node? (When would you use it?)
Summary
The HTTP Request node is your connection to the world. By mastering methods, headers, and body payloads, you ensure that no service—no matter how obscure or custom—is out of your reach.
Next Lesson: Opening the lock: Authentication: API Keys vs OAuth2.