POST / otentikasi / login

Tipe-Konten: aplikasi/json

Terima: aplikasi/json

{

"dsCredentials": {

"tenantName": "...",
"userName": "...",
"password": "...",
"applicationInfos": {
  "applicationName": "...",
  "applicationVersion": "...",
  "serverName": "...",
  "requestID": "..."
},
"mfaCode": "..."

}

}

-1
Stitch 14 Maret 2019, 10:52

1 menjawab

Jawaban Terbaik

Anda dapat menggunakan cURL, misalnya

  $data = [
    'username'      => $username,
    'email'         => $email,
    'password'      => $password
];

//open connection
$ch = curl_init();

//set the url, number of POST vars, POST data
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_POST, count($data));
curl_setopt($ch,CURLOPT_POSTFIELDS, http_build_query($data));

//So that curl_exec returns the contents of the cURL; rather than echoing it
curl_setopt($ch,CURLOPT_RETURNTRANSFER, true); 

//execute post
$result = curl_exec($ch);
echo $result;
0
Quyen Anh Nguyen 14 Maret 2019, 08:12