DocsHTTP Clienthttp_session_request

http_session_request

Http Session Request

Make an HTTP request within a persistent session. Cookies from previous responses are automatically included. Session defaults (headers, proxy, user agent) are applied but can be overridden per-request. New cookies received are stored in the session for future requests. Ideal for multi-step workflows like login followed by authenticated API calls.

Usage Example

123456789101112
import asyncio
from owl_browser import OwlBrowser, RemoteConfig
# Async usage
async with OwlBrowser(config) as browser:
context = await browser.create_context()
context_id = context["context_id"]
await browser.http_session_request(
session_id="value",
url="https://example.com"
)

Parameters

Required

session_idstringrequired

The session ID returned by http_session_create.

urlstringrequired

The full URL to request.

Optional

methodenum
GETPOSTPUTDELETE+3 more

HTTP method. Default: 'GET'

headersstring

Additional HTTP headers as a JSON object or string. Merged with session default headers.

bodystring

Request body content.

cookiesstring

Additional cookies for this request. Accepts string or JSON array from browser_get_cookies.

auth_typeenum
nonebasicbearerdigest

Authentication type for this request.

auth_usernamestring

Username for authentication.

auth_passwordstring

Password for authentication.

auth_tokenstring

Bearer token for authentication.

follow_redirectsboolean

Override session redirect behavior.

timeoutstring

Request timeout in milliseconds.

connect_timeoutstring

Connection timeout in milliseconds.

ssl_verifyboolean

Override session SSL verification.

user_agentstring

Override session User-Agent.

outputenum
textbase64json

Response body output format. Default: 'text'

Response

Returns a JSON object with the operation result.

{
  "success": true,
  "result": <value>
}