JsonRpcRequest
class JsonRpcRequest
Properties
| string|null internal | $source |
Methods
Create a JSON-RPC request.
Parse a JSON-RPC request.
Get the pagination cursor.
Get the requested positive page size.
Get a request parameter.
Get the request metadata.
Determine whether the request uses a legacy protocol version.
Get the HTTP headers mirroring request parameters.
Get the tool, prompt or resource name.
Determine whether the method requires a name header.
Convert the request to an array.
Encode the request as JSON.
Details
at line 25
__construct(int|string $id, string $method, array $params)
Create a JSON-RPC request.
at line 39
static JsonRpcRequest
from(array $jsonRequest)
Parse a JSON-RPC request.
at line 77
string|null
cursor()
Get the pagination cursor.
at line 91
int|null
perPage()
Get the requested positive page size.
at line 105
mixed
get(string $key, mixed $default = null)
Get a request parameter.
at line 115
array|null
meta()
Get the request metadata.
at line 123
bool
isLegacy()
Determine whether the request uses a legacy protocol version.
at line 141
array
mirroredHeaders()
Get the HTTP headers mirroring request parameters.
at line 155
string|null
name()
Get the tool, prompt or resource name.
at line 171
bool
requiresName()
Determine whether the method requires a name header.
at line 191
Request
toRequest()
Convert the protocol arguments to an application request.
at line 218
array
toArray()
Convert the request to an array.
at line 231
string
toJson(int $options = 0)
Encode the request as JSON.