Skip to content

Configuration

import { Aside } from ‘@astrojs/starlight/components’;

Configuration methods can be called at any time, but are typically set once during setup() before any requests are made.

Set the HTTP request timeout.

void setTimeout(uint32_t ms);
ParameterTypeDefaultDescription
msuint32_t10000Timeout in milliseconds.
pb.setTimeout(5000); // 5 s — for fast local networks
pb.setTimeout(30000); // 30 s — for slow or congested connections

When the timeout is reached without a response, the library returns a PBResponse with ok = false and statusCode = 0.


Enable or disable TLS certificate verification.

void setInsecureTLS(bool enabled);
ParameterTypeDefaultDescription
enabledbooltruetrue skips verification; false enforces it.
pb.setInsecureTLS(true); // skip — for self-signed / dev certificates (default)
pb.setInsecureTLS(false); // verify — for production with a valid certificate

Enable or disable verbose debug logging to Serial.

void setDebug(bool enabled);
ParameterTypeDefaultDescription
enabledboolfalsetrue prints request details to Serial.

When enabled, the library prints:

  • Full request URL
  • HTTP status code
  • Raw response body
[PB] GET https://my-pb.com/api/collections/notes/records/abc123
[PB] Status: 200
[PB] Body: {"id":"abc123","title":"Hello","created":"2024-01-15 10:30:00.000Z"}
pb.setDebug(true); // enable during development
pb.setDebug(false); // disable for production