Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, "https://web.spaggiari.eu/rest/v1/auth/login/");
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);//TRUE to return the transfer as a string of the return value of curl_exec() instead of outputting it directly.
- curl_setopt($ch, CURLOPT_POST, TRUE);// TRUE to do a regular HTTP POST. This POST is the normal application/x-www-form-urlencoded kind, most commonly used by HTML forms.
- $data = [
- "uid" => "miouser",
- "pass" => "miapassword",
- ];
- curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
- $headers = [
- "User-Agent" => "zorro/1.0",
- "Z-Dev-Apikey" => "+zorro+",
- "Content-Type" => "application/json",
- ];
- curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
- $response = curl_exec($ch);
- curl_close($ch);
- var_dump($response);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement