Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $curl = curl_init();
- curl_setopt_array($curl, array(
- CURLOPT_URL => "https://app.userengage.com/api/public/users/",
- CURLOPT_RETURNTRANSFER => true,
- CURLOPT_ENCODING => "",
- CURLOPT_MAXREDIRS => 10,
- CURLOPT_TIMEOUT => 30,
- CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
- CURLOPT_CUSTOMREQUEST => "POST",
- CURLOPT_POSTFIELDS => "{'email': 'myemail@mydomain.com','first_name': 'John', 'last_name': 'Doe'}",
- CURLOPT_HTTPHEADER => array(
- "authorization: Token <bug53ggTj9NQHtlQiyrzLf2LXadurwIb5TfFMEXU6FC9E9KH2m45AQcCEW4fBIqr>",
- "content-type: application/json"
- ),
- ));
- $response = curl_exec($curl);
- $err = curl_error($curl);
- curl_close($curl);
- if ($err) {
- echo "cURL Error #:" . $err;
- } else {
- echo $response;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement