Abstract class for handling the JSON and XML requests.
| Properties | |
|---|---|
|
protected
|
Internal variable for storing the API action. |
|
protected
|
Internal variable for storing the API parameter string. |
|
protected
|
Internal variable for storing the response headers. |
| Methods | |
|---|---|
|
abstract
protected
|
This is an auxiliary function for adding error messages, warnings, info messages to the response which might have been collected during handling of the request. |
|
protected
|
Adds a response header to the response. |
|
public
|
This is the main function that should be called to handle the API request. |
|
abstract
protected
|
This is an auxiliary function for parsing the incoming data. |
|
protected
|
This function is called after the processing of the request. It should be overridden if you want to perform some standard action after every API request of your library. |
|
protected
|
This function is called before the processing of the request. It should be overridden if you want to perform some standard action before every API request of your library. |
|
protected
|
This is an auxiliary function for getting request headers and parsing the API url. |
|
abstract
protected
|
This is an auxiliary function for sending the response. |
Internal variable for storing the API action.
Internal variable for storing the API parameter string.
Internal variable for storing the response headers.
This is an auxiliary function for adding error messages, warnings, info messages to the response which might have been collected during handling of the request.
Adds a response header to the response.
| Name | Pass type | Value type | Default value | Description |
|---|---|---|---|---|
| $header | by value | string |
The name of the response header. |
|
| $value | by value | string |
The value of the response header. |
This is the main function that should be called to handle the API request.
It detects the action, retrieves the request headers, parses the incoming JSON data and tries to call the corresponding method for the API action.
It might throw exceptions in the case of any errors.
This is an auxiliary function for parsing the incoming data.
This function is called after the processing of the request. It should be overridden if you want to perform some standard action after every API request of your library.
This function is called before the processing of the request. It should be overridden if you want to perform some standard action before every API request of your library.
The usage example are - validation of the access tokens, checking maintenance mode and reporting it to the user if it is active.
This is an auxiliary function for getting request headers and parsing the API url.
It put the retrieved data into the corresponding properties.
This is an auxiliary function for sending the response.