0
Ich habe diesen Code, der einen Curl-Code darstellt:CURL-Code in PHP darstellen?
curl -X PUT https://example.com/wp-json/wc/v2/products/794 \
-u consumer_key:consumer_secret \
-H "Content-Type: application/json" \
-d '{
"regular_price": "24.54"
}'
Ich brauche diese gleiche ROTATION Code darstellen PHP, für diese versuche ich den folgenden Code:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://example.com/wp-json/wc/v2/products/794');
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)');
curl_setopt($ch, CURLOPT_HTTPHEADER, 'Content-Type: application/json');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
$data = curl_exec($ch);
$httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
-H ist soll der Header sein, aber was sind -u und -d und wie kann ich sie senden?