agentc
GitHubagentc-sh/agentc
agentc
GitHubagentc-sh/agentc
›Introduction
Get started›Concepts in 5 minutes›Build your first agent›Add your first tool›Serve and connect
Concepts›Architecture overview›The manifest›The compilation pipeline›Archetypes›The graph›Tools and capabilities›Runtime libraries›Skills›Agents and prompts›Serving and protocols›Observability
Guides›Author a manifest›Write a tool›Give your agent a filesystem›Control network egress›Connect external tools via MCP›Connect agents via A2A›Use the bash tool›Control tool access with capabilities›Write templated prompts›Manage prompts with Langfuse›Pass context from the client›Configure a model provider›Connect a CopilotKit frontend›Deploy a standalone binary›Deploy with Docker and PostgreSQL›Instrument with OpenTelemetry›Extend code generation with blocks
Reference
Manifest
Runtime
Standard library
Filesystem
HTTP
›JavaScript
›Observability

JavaScript

Every export of agentc:http for JavaScript components.

import { fetch } from "agentc:http"

fetch, Headers, and Response are also installed as globals as the same values this library exports, so the import is optional for those three.

Overview

Symbols
fetch

Make an HTTP request.

Response

The response returned by fetch.

Headers

The headers collection returned on a response.

FetchInit

The request options object.

Functions

fetch

async
fetch(url: string, init?: FetchInit): Promise<Response>

Makes an HTTP request and resolves once the response head has arrived.

Parameters
url
stringrequired

The URL to request. It must be a string. A URL instance is refused.

init
FetchInit

The method, headers, and body.

ReturnsPromise<Response>

The response to the request.

Throws
when the request is refused by the egress policy
when a configured limit is exceeded
when the connection fails

Classes

Response

not constructible

The response to a fetch call.

Properties
status
numberread-only
ok
booleanread-only
url
stringread-only
statusText
stringread-only
bodyUsed
booleanread-only
headers
Headersread-only
body
ReadableStream<Uint8Array>read-only

Reading this property consumes the body. Reading it a second time throws.

text

text(): Promise<string>

Reads the response body as text.

ReturnsPromise<string>

The full response body decoded as text.

json

json(): Promise<unknown>

Reads the response body as JSON.

ReturnsPromise<unknown>

The parsed JSON value.

bytes

bytes(): Promise<Uint8Array>

Reads the response body as bytes.

ReturnsPromise<Uint8Array>

The full response body as bytes.

arrayBuffer

arrayBuffer(): Promise<Uint8Array>

Reads the response body as bytes.

ReturnsPromise<Uint8Array>

The full response body as a Uint8Array, not an ArrayBuffer.

Headers

not constructible

The headers of a response.

get

get(name: string): string | null

Reads a header value by name.

Parameters
name
stringrequired

The header name to read.

Returnsstring | null

The header value, or null when the header is absent.

has

has(name: string): boolean

Checks whether a header is present.

Parameters
name
stringrequired

The header name to check.

Returnsboolean

true when the header is present.

keys

keys(): string[]

Lists the header names.

Returnsstring[]

The response header names.

entries

entries(): string[][]

Lists the headers as name and value pairs.

Returnsstring[][]

The response headers as name and value pairs.

[Symbol.iterator]

[Symbol.iterator](): IterableIterator<string[]>

Iterates over the headers as name and value pairs.

ReturnsIterableIterator<string[]>

An iterator yielding string[] pairs.

Types

FetchInit

Fields not listed here are ignored.

Properties
method
stringoptional
headers
Record<string, string>optional
body
string | Uint8Arrayoptional

What this client does not have

The fetch surface does not include Request, FormData, Blob request bodies, AbortController, AbortSignal, or the signal, redirect, credentials, mode, and cache fields on the init object. Guest code cannot construct a Response or Headers. Streaming request bodies are not supported. Response bodies do stream.

← PreviousHTTPNext →ReAct

© 2026 pogue.dev. All rights reserved.

Creative CommonsCC BY 4.0
On this pageOverviewFunctionsfetchClassesResponsetextjsonbytesarrayBufferHeadersgethaskeysentries[Symbol.iterator]TypesFetchInitWhat this client does not have

Search docs

Search the agentc documentation