request

Functionin requestsfastly-compute 0.1.3View source
request(method: str, url: str, params: dict[str, Any] | None = None, data: str | bytes | dict[str, Any] | None = None, json: dict[str, Any] | None = None, headers: dict[str, str] | None = None, fastly_backend: str | None = None, timeout: None | float | tuple[float, float] = None, fastly_timeout: TimeoutConfig | None = None, **_kwargs: Any) -> FastlyResponse

Send an HTTP request.

Parameters

method: str

HTTP method (GET, POST, PUT, DELETE, etc.)

url: str

URL for the request

params: dict[str, Any] | Noneoptional = None

Query parameters

data: str | bytes | dict[str, Any] | Noneoptional = None

Form data for the request body

json: dict[str, Any] | Noneoptional = None

JSON data for the request body (mutually exclusive with data)

headers: dict[str, str] | Noneoptional = None

HTTP headers

fastly_backend: str | Noneoptional = None

Static backend name (if not provided, will use dynamic backend)

timeout: None | float | tuple[float, float]optional = None

Request timeout in seconds (requests-compatible)

fastly_timeout: TimeoutConfig | Noneoptional = None

Fastly-only Advanced timeout configuration

**_kwargs: Anyoptional

Returns

Throws