Skip to content

Commit fd2fec5

Browse files
committed
Remove unnecessary json_encode when Content-Type is application/json
1 parent 44f09fd commit fd2fec5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/post_json.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
// -d "{"id":"1","content":"Hello world!","date":"2015-06-30 19:42:21"}" \
99
// "https://httpbin.org/post"
1010

11-
$data = json_encode(array(
11+
$data = array(
1212
'id' => '1',
1313
'content' => 'Hello world!',
1414
'date' => date('Y-m-d H:i:s'),
15-
));
15+
);
1616

1717
$curl = new Curl();
1818
$curl->setHeader('Content-Type', 'application/json');

0 commit comments

Comments
 (0)