HttpSessionBrowserProvider
Category: Web
Source: http_session_browser_provider.dart
Classes
HttpSessionRequest
A single HTTP call against a cloud browser provider's session API.
Used both to create a session (the POST in [HttpSessionBrowserProvider .provision]) and to release it (the request returned in [HttpSessionResult.closeRequest]).
Constructor
HttpSessionRequest({
required this.method,
required this.url,
required this.headers,
this.body,
})Properties
| Property | Type | Description |
|---|---|---|
method | String | |
url | Uri | |
headers | Map<String, String> | |
body | Object? | JSON body for the request, if any. Encoded with [jsonEncode]. |
HttpSessionResult
The provisioned endpoint details a provider extracts from its session-creation response.
Constructor
HttpSessionResult({required this.cdpWsUrl, this.viewUrl, this.closeRequest})Properties
| Property | Type | Description |
|---|---|---|
cdpWsUrl | String | |
viewUrl | String? | |
closeRequest | HttpSessionRequest? | Request issued (best-effort) to release the session on close. |
abstract HttpSessionBrowserProvider
Shared base for cloud browser providers that provision a CDP endpoint by POSTing to an HTTP session API.
Owns the apiKey configuration guard and the shared POST / status-check / close plumbing. Subclasses supply only their endpoint, headers, request body, and response mapping via [createRequest] and [mapResponse].
Constructor
HttpSessionBrowserProvider({required this.apiKey, http.Client? client})Properties
| Property | Type | Description |
|---|---|---|
apiKey | String? | |
label | String get | Human-readable provider label used in error messages (e.g. 'Anchor', 'Hyperbrowser'). |
notConfiguredReason | String get | Reason appended after the label when [isConfigured] is false, e.g. 'API key not configured'. |
isConfigured | bool get | |
label | String get | Human-readable provider label used in error messages (e.g. 'Anchor', 'Hyperbrowser'). |
notConfiguredReason | String get | Reason appended after the label when [isConfigured] is false, e.g. 'API key not configured'. |
isConfigured | bool get |
Methods
HttpSessionRequest createRequest()
The request that creates a session.
HttpSessionResult mapResponse(Map<String, dynamic> json)
Map the decoded session-creation response into endpoint details.