Skip to content

Commit

Permalink
Merge pull request #1 from receipt-bank/add-content-type-config
Browse files Browse the repository at this point in the history
Adding default_content_type config value.
  • Loading branch information
matthewswain authored Jun 29, 2021
2 parents 385eace + 534eb84 commit f21758f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/XeroPHP/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class Application
protected static $_config_defaults = [
'xero' => [
'base_url' => 'https://api.xero.com/',
'default_content_type' => Request::CONTENT_TYPE_XML,

'core_version' => '2.0',
'payroll_version' => '1.0',
Expand Down
2 changes: 1 addition & 1 deletion src/XeroPHP/Remote/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function __construct(Application $app, URL $url, $method = self::METHOD_G
}

//Default to XML so you get the xsi:type attribute in the root node.
$this->setHeader(self::HEADER_ACCEPT, self::CONTENT_TYPE_XML);
$this->setHeader(self::HEADER_ACCEPT, $app->getConfigOption('xero', 'default_content_type'));

$xero_config = $this->app->getConfig('xero');
if (isset($xero_config['unitdp'])) {
Expand Down

0 comments on commit f21758f

Please sign in to comment.