Skip to content

Commit 23343af

Browse files
committed
Merge branch 'release/0.5.1'
2 parents d8c3168 + e019ce6 commit 23343af

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/Bitbucket/API/Http/Client.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class Client implements ClientInterface
3333
'api_versions' => array('1.0', '2.0'), // supported versions
3434
'format' => 'json',
3535
'formats' => array('json', 'xml'), // supported response formats
36-
'user_agent' => 'bitbucket-api-php/0.5.0 (https://bitbucket.org/gentlero/bitbucket-api)',
36+
'user_agent' => 'bitbucket-api-php/0.5.1 (https://bitbucket.org/gentlero/bitbucket-api)',
3737
'timeout' => 10,
3838
'verify_peer' => false
3939
);
@@ -182,6 +182,11 @@ public function request($endpoint, $params = array(), $method = 'GET', array $he
182182
$endpoint .= (strpos($endpoint, '?') === false ? '?' : '&').'format='.$this->getResponseFormat();
183183
}
184184

185+
// add a default content-type if none was set
186+
if (in_array(strtoupper($method), array('POST', 'PUT')) && empty($headers['Content-Type'])) {
187+
$headers['Content-Type'] = 'application/x-www-form-urlencoded';
188+
}
189+
185190
$request = $this->createRequest($method, $endpoint);
186191

187192
if (!empty($headers)) {

0 commit comments

Comments
 (0)