So konvertieren Sie die PHP -Curl -Anforderung in die Befehlszeilencurl

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: So konvertieren Sie die PHP -Curl -Anforderung in die Befehlszeilencurl

by Anonymous » 28 Feb 2025, 05:17

So übersetzen Sie die folgende PHP -Curl -Anforderung in den Befehl curl ausführbar. < /p>

$curlOpts = array(
CURLOPT_PORT => "3000",
CURLOPT_URL => 'www.example.com',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => array("Cookie: connect.sid=aASD234SDFfds", "content-type:application/json"),
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => {"email": "test.com",
"password": "123456"},
);

curl_setopt_array($ch, $curlOpts);
$output = curl_exec($ch);
< /code>

Respektiertes Curl -Befehl, den ich möchte < /p>

curl -X GET --header 'Accept: application/json' 'http://www.example.com?sort=clicks&order=des'

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ \
"email": "test.com", \
"password": "123456" \
}' 'http://example.com/login'
< /code>

Bitte helfen Sie mir dafür. < /p>

Top