Sign in | Sign up

Specify Fields cURL & PHP


Currently contains 2 posts


May 06, 2014 15:18


How do I specify certain fields in the following format?

curl_setopt($ch, CURLOPT_POSTFIELDS,

I tried;
curl_setopt($ch, CURLOPT_POSTFIELDS,
“appId=APPID&appKey=APPKEY&query=milk&fields=item_name, nf_calories”);
But, I get a “fields must be a JSON array” error. Any suggestions?


May 07, 2014 18:35

Matt Silverman

Sorry, we are not able to give programming language specific support. It appears that you have an issue with your general PHP syntax. Please check out this PHP library for reference as well:

Reply to thread