Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $username = "user";
- $password = "password";
- $postData = array(
- 'username' => $username,
- 'password' => $password,
- 'msisdn' => "111111111"
- );
- $ch = curl_init('http://ip:<port>/xxx/yyy/zzz');
- curl_setopt_array($ch, array(
- CURLOPT_POST => TRUE,
- CURLOPT_RETURNTRANSFER => TRUE,
- CURLOPT_HTTPHEADER => array(
- 'Content-Type: application/json'
- ),
- CURLOPT_POSTFIELDS => json_encode($postData)
- ));
- // Send the request
- $response = curl_exec($ch);
- // Check for errors
- if($response === FALSE){
- die(curl_error($ch));
- }
- // Decode the response
- $responseData = json_decode($response, TRUE);
- // Print the date from the response
- echo $responseData['published'];
- var_dump($responseData);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement