mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-09-14 12:26:51 +00:00
Use https
This commit is contained in:
@@ -41,19 +41,19 @@ require __DIR__ . '/vendor/autoload.php';
|
||||
use \Curl\Curl;
|
||||
|
||||
$curl = new Curl();
|
||||
$curl->get('http://www.example.com/');
|
||||
$curl->get('https://www.example.com/');
|
||||
```
|
||||
|
||||
```php
|
||||
$curl = new Curl();
|
||||
$curl->get('http://www.example.com/search', array(
|
||||
$curl->get('https://www.example.com/search', array(
|
||||
'q' => 'keyword',
|
||||
));
|
||||
```
|
||||
|
||||
```php
|
||||
$curl = new Curl();
|
||||
$curl->post('http://www.example.com/login/', array(
|
||||
$curl->post('https://www.example.com/login/', array(
|
||||
'username' => 'myusername',
|
||||
'password' => 'mypassword',
|
||||
));
|
||||
@@ -66,7 +66,7 @@ $curl->setUserAgent('');
|
||||
$curl->setReferrer('');
|
||||
$curl->setHeader('X-Requested-With', 'XMLHttpRequest');
|
||||
$curl->setCookie('key', 'value');
|
||||
$curl->get('http://www.example.com/');
|
||||
$curl->get('https://www.example.com/');
|
||||
|
||||
if ($curl->error) {
|
||||
echo 'Error: ' . $curl->errorCode . ': ' . $curl->errorMessage;
|
||||
@@ -87,7 +87,7 @@ $curl->get('https://encrypted.example.com/');
|
||||
|
||||
```php
|
||||
$curl = new Curl();
|
||||
$curl->put('http://api.example.com/user/', array(
|
||||
$curl->put('https://api.example.com/user/', array(
|
||||
'first_name' => 'Zach',
|
||||
'last_name' => 'Borboa',
|
||||
));
|
||||
@@ -95,21 +95,21 @@ $curl->put('http://api.example.com/user/', array(
|
||||
|
||||
```php
|
||||
$curl = new Curl();
|
||||
$curl->patch('http://api.example.com/profile/', array(
|
||||
$curl->patch('https://api.example.com/profile/', array(
|
||||
'image' => '@path/to/file.jpg',
|
||||
));
|
||||
```
|
||||
|
||||
```php
|
||||
$curl = new Curl();
|
||||
$curl->patch('http://api.example.com/profile/', array(
|
||||
$curl->patch('https://api.example.com/profile/', array(
|
||||
'image' => new CURLFile('path/to/file.jpg'),
|
||||
));
|
||||
```
|
||||
|
||||
```php
|
||||
$curl = new Curl();
|
||||
$curl->delete('http://api.example.com/user/', array(
|
||||
$curl->delete('https://api.example.com/user/', array(
|
||||
'id' => '1234',
|
||||
));
|
||||
```
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# PHP Curl Class Documentation
|
||||
http://www.phpcurlclass.com/
|
||||
https://www.phpcurlclass.com/
|
||||
|
||||
The [examples](https://github.com/php-curl-class/php-curl-class/tree/master/examples) are a great starting point.
|
||||
|
||||
@@ -5,7 +5,7 @@ use \Curl\Curl;
|
||||
|
||||
$address = 'Paris, France';
|
||||
$curl = new Curl();
|
||||
$curl->get('http://maps.googleapis.com/maps/api/geocode/json', array(
|
||||
$curl->get('https://maps.googleapis.com/maps/api/geocode/json', array(
|
||||
'address' => $address,
|
||||
));
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// using GET requests).
|
||||
$curl = new Curl();
|
||||
$curl->setOpt(CURLOPT_FOLLOWLOCATION, true);
|
||||
$curl->post('http://www.example.com/login/', array(
|
||||
$curl->post('https://www.example.com/login/', array(
|
||||
'username' => 'myusername',
|
||||
'password' => 'mypassword',
|
||||
));
|
||||
@@ -13,7 +13,7 @@ $curl->post('http://www.example.com/login/', array(
|
||||
// https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.4
|
||||
$curl = new Curl();
|
||||
$curl->setOpt(CURLOPT_FOLLOWLOCATION, true);
|
||||
$curl->post('http://www.example.com/login/', array(
|
||||
$curl->post('https://www.example.com/login/', array(
|
||||
'username' => 'myusername',
|
||||
'password' => 'mypassword',
|
||||
), false);
|
||||
|
||||
@@ -9,7 +9,7 @@ if (isset($_GET['after'])) {
|
||||
}
|
||||
|
||||
$curl = new Curl();
|
||||
$curl->get('http://www.reddit.com/r/pics/top/.json', $data);
|
||||
$curl->get('https://www.reddit.com/r/pics/top/.json', $data);
|
||||
|
||||
echo '<ul>';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user