Overview
The HTTP Request command provides functionality for:- Making GET, POST, PUT, DELETE, and other HTTP method requests
- Configuring request headers, query parameters, and request bodies
- Handling authentication and authorization
- Managing timeouts and error handling
- Processing HTTP responses
Command Type
Command Type ID: 1001Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| url | string | The target URL for the HTTP request | Yes |
| method | string | HTTP method (GET, POST, PUT, DELETE, PATCH, etc.) | No (defaults to GET) |
| headers | object | HTTP headers to include in the request | No |
| body | string/object | Request body for POST/PUT requests | No |
| timeout | number | Maximum wait time in milliseconds | No |
| queryParams | object | URL query parameters | No |
| followRedirects | boolean | Whether to follow HTTP redirects | No (defaults to true) |
Usage Examples
Basic GET Request
POST Request with Body
GET Request with Query Parameters
Request with Authentication
Request with Project Variables
Variable Support
The HTTP Request command supports variable interpolation in:- URLs: Use
@{VARIABLE}in URLs - Headers: Use
@{VARIABLE}or%{SECRET}in header values - Query Parameters: Use variables in query parameter values
- Request Body: Use variables in request body content
Variable Types
- Project Variables:
@{PROJECT_ID},@{RUN_ID},@{START_TIMESTAMP} - Secrets:
%{API_KEY},%{API_TOKEN},%{PROXY_PASSWORD} - Session Variables:
#{UUID}for session tracking - Event Variables:
${event_id}for event-specific values
Response Handling
The HTTP Request command returns the HTTP response which can be used by subsequent commands:Response Structure
Using Response Data
The response from HTTP Request can be used as input for subsequent commands:Error Handling
The HTTP Request command handles various error scenarios:- Timeout Errors: Returns error if request exceeds timeout
- Network Errors: Handles connection failures
- HTTP Errors: Returns error status for non-2xx responses
- Invalid URLs: Validates URL format before request
Best Practices
- Use Secrets for Credentials: Always use
%{SECRET_NAME}for API keys and passwords - Set Appropriate Timeouts: Configure timeouts based on expected response times (default: 30 seconds)
- Handle Errors: Implement error handling for failed requests
- Use Project Variables: Leverage
@{PROJECT_ID}and@{RUN_ID}for tracking - Validate Responses: Always validate response structure before processing
- Use HTTPS: Prefer HTTPS URLs for secure communication
- Set Content-Type: Explicitly set Content-Type header for POST/PUT requests
Common Use Cases
- API Integration: Fetch data from REST APIs
- Web Scraping: Retrieve HTML content from web pages
- Data Synchronization: Pull data from external services
- Authentication: Handle API authentication flows
- Webhook Processing: Send data to webhook endpoints
Related Commands
- JSON Parse - Parse HTTP response data
- Json Path - Extract data from HTTP responses
- Validation Commands - Validate HTTP responses
Troubleshooting
Request Timeout
If requests are timing out:- Increase the
timeoutparameter value - Check network connectivity
- Verify the target server is accessible
Authentication Errors
If authentication fails:- Verify secrets are correctly configured
- Check API key/token format
- Ensure headers are properly formatted
Invalid Response
If response structure is unexpected:- Check response status code
- Verify Content-Type header
- Validate response body format