The command line curl is:
curl https://sitea.com/v1 -X PUT \
-d callback_url="https://siteb.com/event" \
I have
ch = curl_init();
$callback_url = " https://sitea.com/v1";
curl_setopt($ch, CURLOPT_URL, $callback_url);
curl_exec($ch);
However, I am not sure about how to deal with the remaining options. What’s -X, -d etc? and how do I express that curl command via PHP (not command line)
Thanks everyone!
-Xspecifies the command (HTTP verb) to use. In this case, itsPUT. The equivalent would becurl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');-dis the data (the payload) you want to send with the request. The equivalent would becurl_setopt($ch, CURLOPT_POSTFIELDS, 'callback_url="https://siteb.com/event"');As others have mentioned in the comments, the first place to check “what does this option do” is the manual page (called the man page because
manis the command used to load the documentation). If you do not have the curl utility installed, there are lots of websites that provide online search of Linux manual pages. One is http://man.he.net/