Hallo zusammen,
Ich versuche vergeblich folgenden curl Befehl
1 | curl \
|
2 | -X PATCH \
|
3 | --header "Content-Type:application/json" \
|
4 | --data '{"type": "value", "valueOrExpression": 1337}' \
|
5 | --user "user:password" \
|
6 | http://test/api/variables/the-answer
|
In PHP darzustellen hier mein Versuch
1 | $ch = curl_init();
|
2 |
|
3 | $data = array('value':'1337');
|
4 |
|
5 | curl_setopt($ch, CURLOPT_URL, 'http://Test/api/variables/the-answer');
|
6 | curl_setopt($ch, CURLOPT_POST, 1);
|
7 | curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
|
8 |
|
9 | curl_exec($ch);
|
Aber es klappt nicht?!