HTTP Request Node — যেকোনো API call করুন

লেসন ৮ / ২৫

HTTP Request Node কী?

HTTP Request node দিয়ে যেকোনো REST API-তে call করা যায় — এটি n8n-এর সবচেয়ে শক্তিশালী node।

GET Request — ডেটা পড়া

Method: GET
URL: https://jsonplaceholder.typicode.com/posts/1

Response:
{
  "id": 1,
  "title": "sunt aut facere...",
  "body": "quia et suscipit..."
}

POST Request — ডেটা পাঠানো

Method: POST
URL: https://api.example.com/users
Content-Type: application/json

Body (JSON):
{
  "name": "{{ $json.name }}",
  "email": "{{ $json.email }}",
  "phone": "{{ $json.phone }}"
}

Authentication পদ্ধতি

  • None — public API
  • API Key — Header বা Query param-এ key পাঠানো
  • Bearer Token — Authorization: Bearer TOKEN
  • Basic Auth — username:password (Base64)
  • OAuth2 — Google, Facebook, Twitter API
# API Key Header উদাহরণ
Header Name: X-API-Key
Header Value: your-secret-api-key-here

# Bearer Token উদাহরণ
Header Name: Authorization
Header Value: Bearer eyJhbGciOiJIUzI1NiIs...

Query Parameters

URL: https://api.example.com/search
Parameters:
  q       → {{ $json.searchTerm }}
  limit   → 10
  offset  → 0
  sort    → created_at

Final URL: https://api.example.com/search?q=n8n&limit=10&offset=0&sort=created_at

Response Handling

Response Format: JSON (স্বয়ংক্রিয় parse হবে)

# নির্দিষ্ট field access:
{{ $json.data.users[0].name }}
{{ $json.total }}
{{ $json.status }}

Error Handling

  • Continue on Fail — error হলেও পরের node-এ যাবে
  • Retry on Fail — নির্দিষ্ট সংখ্যক retry
  • Error Workflow — error হলে আলাদা workflow চালানো