We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 653d4fe commit 2dc30b5Copy full SHA for 2dc30b5
lib/Github/Client.php
@@ -158,6 +158,8 @@ public function __construct(HttpClient $httpClient = null)
158
$this->addPlugin(new Plugin\HeaderDefaultsPlugin(array(
159
'User-Agent' => 'php-github-api (http://github.com/KnpLabs/php-github-api)',
160
)));
161
+ // Add standard headers.
162
+ $this->clearHeaders();
163
}
164
165
/**
@@ -430,6 +432,12 @@ public function setOption($name, $value)
430
432
throw new InvalidArgumentException(sprintf('Undefined option called: "%s"', $name));
431
433
434
435
+ if ($name === 'api_version') {
436
+ $this->addHeaders([
437
+ 'Accept' => sprintf('application/vnd.github.%s+json', $value),
438
+ ]);
439
+ }
440
+
441
$this->options[$name] = $value;
442
443
0 commit comments