Skip to content

Commit

Permalink
fixed post content type
Browse files Browse the repository at this point in the history
  • Loading branch information
elmage committed Aug 19, 2020
1 parent b3cfb80 commit 8d1431e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/HttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,17 @@ private function prepareOptions(array $params = array())
$options = array();

if (count($params) > 0) {
$options[RequestOptions::JSON] = $params;
$options[RequestOptions::FORM_PARAMS] = $params;
$options[RequestOptions::VERIFY] = false;
$body = json_encode($params);
} else {
$body = '';
}

$defaultHeaders = array(
'User-Agent' => 'elmage/textng/php/'.Client::VERSION,
'Content-Type' => 'application/json',
'Accept' => 'text/plain, application/json',
'Content-Type' => 'application/x-www-form-urlencoded',
'Accept' => 'text/plain, application/json', 'text/html',
);

$options[RequestOptions::HEADERS] = $defaultHeaders;
Expand Down

0 comments on commit 8d1431e

Please sign in to comment.