mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-08-30 20:20:53 +00:00
Remove unnecessary json_encode when Content-Type is application/json
This commit is contained in:
@@ -8,11 +8,11 @@ use \Curl\Curl;
|
||||
// -d "{"id":"1","content":"Hello world!","date":"2015-06-30 19:42:21"}" \
|
||||
// "https://httpbin.org/post"
|
||||
|
||||
$data = json_encode(array(
|
||||
$data = array(
|
||||
'id' => '1',
|
||||
'content' => 'Hello world!',
|
||||
'date' => date('Y-m-d H:i:s'),
|
||||
));
|
||||
);
|
||||
|
||||
$curl = new Curl();
|
||||
$curl->setHeader('Content-Type', 'application/json');
|
||||
|
||||
Reference in New Issue
Block a user