fetch

HTTP fetch utilities with automatic retry and exponential backoff.

Functions

Function
Description
Example

get

Perform GET request with retry

dphelper.fetch.get(url, options)

post

Perform POST request with JSON

dphelper.fetch.post(url, body, options)

Description

HTTP request utilities:

  • GET - Fetch data with automatic retries

  • POST - Send JSON data with automatic JSON headers

  • Retry - Exponential backoff on failure

  • Error Handling - Automatic retry on network errors

Usage Examples

GET Request

// Simple GET request
const response = await dphelper.fetch.get('https://api.example.com/data');
const data = await response.json();

// GET with options
const users = await dphelper.fetch.get('/api/users', {
  headers: { 'Authorization': 'Bearer token' }
});

POST Request

Error Handling with Retry

API Integration

Details

  • Author: Dario Passariello

  • Version: 0.0.1

  • Creation Date: 20260221

  • Last Modified: 20260221

  • Environment: both (browser + Node.js)


Automatically generated document

Last updated