request
Send a request by protocol method name and return its decoded result.
Call a canonical Herdr socket method and return its result.
Use the convenience methods when one exists. This low-level operation is useful for canonical protocol methods that do not yet have a wrapper.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
method
|
str
|
Canonical JSON method name, such as |
required |
params
|
object | None
|
JSON object containing method parameters, or |
None
|
Returns:
| Type | Description |
|---|---|
ResponseResult
|
The validated result object returned by Herdr. |
Raises:
| Type | Description |
|---|---|
HerdrClientError
|
If the method is unsupported or the socket exchange fails. |
TypeError
|
If |
HerdrApiError
|
If Herdr returns an error envelope. |
Example
await client.request("workspace.list")
await client.request("pane.read", {"pane_id": "build"})
Source code in src/herdr_client/async_client/client.py
298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 | |