-
Notifications
You must be signed in to change notification settings - Fork 5
Headers
Ale Mostajo edited this page Sep 30, 2020
·
1 revision
The client supports the ability to specify custom HTTP headers.
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...
}
);
Parameter | Type | Description |
---|---|---|
key |
string |
Header key. |
value |
string |
Header value. |
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...
}
);