Headers - 10quality/license-keys-php-client GitHub Wiki
The client supports the ability to specify custom HTTP headers.
Usage
Headers can be added using the header()
chainable method after instantiating the Client
, like this:
$response = Api::activate(
Client::instance()
->header('Authorization', 'Bearer {token}')
->header('X-Token', '{value}'),
function() use($licenseKey) {
// Code here...
},
function($licenseString) {
// Code here...
}
);
Parameters
Parameter | Type | Description |
---|---|---|
key |
string |
Header key. |
value |
string |
Header value. |
Clear all headers
Pass a null
value to clear al previously added headers.
$response = Api::activate(
Client::instance()->header(null),
function() use($licenseKey) {
// Code here...
},
function($licenseString) {
// Code here...
}
);