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.
setTimeout()
Section titled “setTimeout()”Set the HTTP request timeout.
void setTimeout(uint32_t ms);| Parameter | Type | Default | Description |
|---|---|---|---|
ms | uint32_t | 10000 | Timeout in milliseconds. |
pb.setTimeout(5000); // 5 s — for fast local networkspb.setTimeout(30000); // 30 s — for slow or congested connectionsWhen the timeout is reached without a response, the library returns a PBResponse with ok = false and statusCode = 0.
setInsecureTLS()
Section titled “setInsecureTLS()”Enable or disable TLS certificate verification.
void setInsecureTLS(bool enabled);| Parameter | Type | Default | Description |
|---|---|---|---|
enabled | bool | true | true skips verification; false enforces it. |
pb.setInsecureTLS(true); // skip — for self-signed / dev certificates (default)pb.setInsecureTLS(false); // verify — for production with a valid certificatesetDebug()
Section titled “setDebug()”Enable or disable verbose debug logging to Serial.
void setDebug(bool enabled);| Parameter | Type | Default | Description |
|---|---|---|---|
enabled | bool | false | true 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 developmentpb.setDebug(false); // disable for production