Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $url = "http://domain.com";
- $ch = curl_init($url);
- curl_setopt($ch, CURLOPT_TIMEOUT, 30); //Timeout after 30 seconds
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- $status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); //Get status code
- $response = curl_exec($ch);
- curl_close($ch);
- echo $response;
- ?>
- <?php
- $username = "username";
- $password = "password";
- $url = "https://domain.com/api/v2/orders/count";
- $ch = curl_init($url);
- curl_setopt($ch, CURLOPT_TIMEOUT, 30); //Timeout after 30 seconds
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
- curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");
- $status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); //Get status code
- $response = curl_exec($ch);
- curl_close($ch);
- echo $response;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement