Skip to content

Commit

Permalink
Merge pull request #274 from inkover/master
Browse files Browse the repository at this point in the history
Add support of 'application/json' in HTTP client's post() method (#273)
  • Loading branch information
tombouctou committed Mar 23, 2017
2 parents 05b7b76 + 2fffdc9 commit f91ba75
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion PHPDaemon/Clients/HTTP/Connection.php
Expand Up @@ -231,7 +231,7 @@ public function post($url, $data = [], $params = null)
}
if ($params['contentType'] === 'application/x-www-form-urlencoded') {
$body = http_build_query($data, '', '&', PHP_QUERY_RFC3986);
} elseif ($params['contentType'] === 'application/x-json') {
} elseif ($params['contentType'] === 'application/x-json' || $params['contentType'] === 'application/json') {
$body = json_encode($data);
} else {
$body = 'Unsupported Content-Type';
Expand Down

0 comments on commit f91ba75

Please sign in to comment.