Part API275 Documents

Outbound Requests

Part API must use the shared http.js utility for every outbound HTTP request. Set a timeout and maximum response size in http.js. Check each response and return a localized error when a request fails. Do not log secrets or customer data. Retry only when safe; do not retry writes unless repeating them cannot create duplicates.

Correct

import { httpPost } from 'core'
const response = await httpPost(url, payload)

Incorrect

const response = await fetch(url, options)
import { request } from 'undici'

Fix

Add timeout and response-size limits to http.js, then use it for every outbound HTTP request. Check responses and handle failures with localized errors.