Skip to main content

HTTP Request Worker

Handles outbound HTTP requests for webhooks and external API integrations.

Included in Base Preset

This plugin is part of the base preset and loaded automatically. Using the base preset is strongly recommended, so explicit installation is usually not required.

Installation

import '@unchainedshop/plugins/worker/http-request';

Features

  • Outbound Webhooks: Send HTTP requests to external services
  • Configurable Methods: Support for GET and POST methods
  • Headers Support: Custom headers for authentication
  • JSON Payloads: Automatic JSON serialization for POST requests
  • Response Parsing: Automatic JSON/text response handling

Usage

Create HTTP request work:

mutation CreateWebhook {
createWork(
type: "HTTP_REQUEST"
input: {
url: "https://api.example.com/webhook"
method: "POST"
headers: { "Authorization": "Bearer token" }
data: { "event": "order.created", "orderId": "123" }
}
) {
_id
status
}
}

Input Parameters

ParameterTypeDescription
urlStringTarget URL (required)
methodStringHTTP method: GET or POST (default: POST)
headersObjectRequest headers
dataObjectRequest body for POST requests (JSON serialized)

Adapter Details

PropertyValue
Keyshop.unchained.worker-plugin.http-request
Sourceworker/http-request.ts