Comments on: How to POST and Receive JSON Data using PHP cURL https://www.codexworld.com/post-receive-json-data-using-php-curl/ Web & Mobile App Development Company Sat, 08 Jul 2023 06:32:03 +0000 hourly 1 By: VladAst https://www.codexworld.com/post-receive-json-data-using-php-curl/comment-page-1/#comment-237419 Sat, 08 Jul 2023 06:32:03 +0000 https://www.codexworld.com/?p=2696#comment-237419 Thank you very much!

P. s. “user” and $payload are not require. You can just write:

curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));

]]>
By: Valentin Secades https://www.codexworld.com/post-receive-json-data-using-php-curl/comment-page-1/#comment-225833 Sun, 08 Jan 2023 21:39:15 +0000 https://www.codexworld.com/?p=2696#comment-225833 //The data you want to send via POST
$payload = json_encode($message);

This is unnecessary. You can post a straight out JSON formatted string and it should work as expected.

]]>
By: Harshana Malshan https://www.codexworld.com/post-receive-json-data-using-php-curl/comment-page-1/#comment-155428 Fri, 29 Oct 2021 09:48:58 +0000 https://www.codexworld.com/?p=2696#comment-155428 This is a very useful article for all HPP developers.

]]>
By: marco https://www.codexworld.com/post-receive-json-data-using-php-curl/comment-page-1/#comment-125157 Sat, 17 Oct 2020 15:12:09 +0000 https://www.codexworld.com/?p=2696#comment-125157 Hi i not understand this point:

$payload = json_encode(array(“user” => $data));
what is user? is a name for array data?

]]>
By: Tracy https://www.codexworld.com/post-receive-json-data-using-php-curl/comment-page-1/#comment-114706 Sat, 30 May 2020 03:06:53 +0000 https://www.codexworld.com/?p=2696#comment-114706 Thank you so much. Finally getting a response has made my day

]]>
By: Marcelo https://www.codexworld.com/post-receive-json-data-using-php-curl/comment-page-1/#comment-114636 Thu, 28 May 2020 17:57:57 +0000 https://www.codexworld.com/?p=2696#comment-114636 Perfect! Thank very mush.

]]>
By: Saad https://www.codexworld.com/post-receive-json-data-using-php-curl/comment-page-1/#comment-99738 Wed, 11 Dec 2019 09:24:45 +0000 https://www.codexworld.com/?p=2696#comment-99738 It’s really helpful

]]>
By: mohamed amine Modni https://www.codexworld.com/post-receive-json-data-using-php-curl/comment-page-1/#comment-99558 Sun, 08 Dec 2019 19:35:23 +0000 https://www.codexworld.com/?p=2696#comment-99558 what about sending a GET request with a json data ?

]]>
By: Chuck https://www.codexworld.com/post-receive-json-data-using-php-curl/comment-page-1/#comment-98392 Fri, 22 Nov 2019 18:25:32 +0000 https://www.codexworld.com/?p=2696#comment-98392 Short and sweet. Thank you for the post, this helped me get up and running quickly

]]>
By: Mateus https://www.codexworld.com/post-receive-json-data-using-php-curl/comment-page-1/#comment-85386 Mon, 13 May 2019 15:05:24 +0000 https://www.codexworld.com/?p=2696#comment-85386 Great !!!

]]>