Skip to Content
Puppi
Connectors

HTTP

Call a JSON API that has no connector of its own.

@puppi/adapter-http is a JSON connection for an API that has no connector of its own. get(path, params) sends GET <base_url><path> and decodes the body as JSON.

Pass the module to defineConfig:

import * as http from "@puppi/adapter-http";
import { defineConfig } from "@puppi/sdk";

export default defineConfig({
  connections: { api: http },
});

Config

FieldMeaning
base_urlHost the binding sets.
headersJSON object added to every request.
api_key_headerHeader name for api_key. The default is x-api-key.
api_key_queryQuery parameter name for api_key. When it is set, the key is not sent as a header.

Secrets

Both secrets are optional. An empty value sends nothing.

SecretSent as
bearer_tokenAuthorization: Bearer
api_keyThe header named by api_key_header, or the query parameter named by api_key_query

On this page