REST
Less than 1 minute
REST
Properties
serverConfig
public Config $serverConfig
client
private Client $client
protocol
private Protocol $protocol
Methods
__construct
public __construct({Array})
Parameters
Parameter | Type | Description |
---|---|---|
$serverConfig | Map |
trigger
Triggers an event and sends the corresponding data.
public trigger({Array})
Parameters
Parameter | Type | Description |
---|---|---|
$event | string | the event identifier |
$data | mixed | The data to be sent with the event. Default is null. |
$options | mixed | Additional options for the event. Default is null. |
$response | Response |
send
Sends a request to the configured server.
private send({Array})
This method constructs a URL based on the server configuration and sends a POST request with the specified type and data. It handles cases where the client server or port is not specified by defaulting to the server's listen address and port. Additionally, it sets up the authorization header if an admin key is provided.
Parameters
Parameter | Type | Description |
---|---|---|
$type | string | the type of the request |
$data | mixed | The data to be sent with the request. Default is null. |
$options | mixed | Additional options for the request. Default is null. |
$response | Response |
Generated by Hazaar API Doc Generator