Integration
requests
HTTP/API request management
requests
HTTP/API request management with automatic retries, caching, rate limiting, and request/response transformation.
Overview
The requests primitive provides a high-level interface for making HTTP requests with built-in best practices for reliability, performance, and error handling.
Quick Example
import { requests } from 'sdk.do'
// Simple GET request
const data = await requests.get('https://api.example.com/users')
// POST with retry logic
const user = await requests.post('https://api.example.com/users', {
body: { name: 'Alice', email: '[email protected]' },
retries: 3,
timeout: 5000,
})
// With caching
const products = await requests.get('https://api.example.com/products', {
cache: '5m', // Cache for 5 minutes
})Core Capabilities
- Automatic Retries - Exponential backoff for failed requests
- Request Caching - In-memory and persistent caching
- Rate Limiting - Prevent overwhelming external APIs
- Timeout Management - Configurable request timeouts
- Transform Pipeline - Pre/post request transformations
Access Methods
SDK
TypeScript/JavaScript library for HTTP requests
await requests.get('https://api.example.com/users')CLI
Command-line tool for HTTP requests
do request get https://api.example.com/usersAPI
REST/RPC endpoints for proxied requests
curl -X POST https://api.do/v1/requests -d '{"url":"https://api.example.com/users"}'MCP
Model Context Protocol for AI-driven HTTP requests
Make a GET request to https://api.example.com/users