File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 3
3
4
4
use \Curl \Curl ;
5
5
6
- // curl -X PUT -d "id=1&first_name=Zach&last_name=Borboa" "http ://httpbin.org/put"
6
+ // curl -X PUT -d "id=1&first_name=Zach&last_name=Borboa" "https ://httpbin.org/put"
7
7
$ curl = new Curl ();
8
- $ curl ->put ('http ://httpbin.org/put ' , array (
8
+ $ curl ->put ('https ://httpbin.org/put ' , array (
9
9
'id ' => 1 ,
10
10
'first_name ' => 'Zach ' ,
11
11
'last_name ' => 'Borboa ' ,
Original file line number Diff line number Diff line change
1
+ <?php
2
+ require '../src/Curl/Curl.php ' ;
3
+
4
+ use \Curl \Curl ;
5
+
6
+ $ myfile = curl_file_create ('cats.jpg ' , 'image/png ' , 'test_name ' );
7
+
8
+ $ curl = new Curl ();
9
+ $ curl ->post ('https://httpbin.org/post ' , array (
10
+ 'myfile ' => $ myfile ,
11
+ ));
12
+
13
+ if ($ curl ->error ) {
14
+ echo 'Error: ' . $ curl ->error_message . "\n" ;
15
+ } else {
16
+ echo 'Success ' . "\n" ;
17
+ }
You can’t perform that action at this time.
0 commit comments