Native 'setMashapeKey' method for X-Mashape-Key header

This commit is contained in:
thibaultCha
2015-02-05 20:49:06 -08:00
parent f6fc64103f
commit fb241f6898
2 changed files with 24 additions and 2 deletions

View File

@@ -87,6 +87,20 @@ class Request
return self::$defaultHeaders[$name] = $value;
}
/**
* Set a Mashape key to send on every request as a header
* Obtain your Mashape key by browsing one of your Mashape applications on https://www.mashape.com
*
* Note: Mashape provides 2 keys for each application: a 'Testing' and a 'Production' one.
* Be aware of which key you are using and do not share your Production key.
*
* @param string $key Mashape key
*/
public static function setMashapeKey($key)
{
return self::$defaultHeaders['X-Mashape-Key'] = $key;
}
/**
* Clear all the default headers
*/