File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 9
9
EOF ;
10
10
11
11
$ curl = new Curl ();
12
- $ curl ->post ('https://api.github.com/gists ' , json_encode (array (
12
+ $ curl ->setHeader ('Content-Type ' , 'application/json ' );
13
+ $ curl ->post ('https://api.github.com/gists ' , array (
13
14
'description ' => 'PHP-Curl-Class test. ' ,
14
15
'public ' => 'true ' ,
15
16
'files ' => array (
16
17
'Untitled.php ' => array (
17
18
'content ' => $ content ,
18
19
),
19
20
),
20
- ))) ;
21
+ ));
21
22
22
23
echo 'Gist created at ' . $ curl ->response ->html_url . "\n" ;
Original file line number Diff line number Diff line change 22
22
$ curl = new Curl ();
23
23
$ curl ->setHeader ('Content-Type ' , 'application/json ' );
24
24
$ curl ->setBasicAuthentication (GRATIPAY_API_KEY );
25
- $ curl ->post ('https://gratipay.com/ ' . GRATIPAY_USERNAME . '/tips.json ' , json_encode ( $ data) );
25
+ $ curl ->post ('https://gratipay.com/ ' . GRATIPAY_USERNAME . '/tips.json ' , $ data );
26
26
27
27
foreach ($ curl ->response as $ tip ) {
28
28
echo $ tip ->amount . ' given to ' . $ tip ->username . '. ' . "\n" ;
You can’t perform that action at this time.
0 commit comments