Skip to content

Commit 7edb0a2

Browse files
committed
Improved signature
1 parent a828d5c commit 7edb0a2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/client_auth.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
$cookiejar = tempnam(sys_get_temp_dir(), 'cookiejar-');
55

6-
function call($method, $url, $data = false, $csrf = false) {
6+
function call($method, $url, $csrf = false, $data = false) {
77
global $cookiejar;
88
$ch = curl_init();
99
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
@@ -27,8 +27,8 @@ function call($method, $url, $data = false, $csrf = false) {
2727
}
2828

2929
// in case you are using php-api-auth:
30-
$csrf = json_decode(call('POST','http://localhost/api.php/', 'username=admin&password=admin'));
31-
$response = call('GET','http://localhost/api.php/posts?include=categories,tags,comments&filter=id,eq,1', false, $csrf);
30+
$csrf = json_decode(call('POST','http://localhost/api.php/', false, 'username=admin&password=admin'));
31+
$response = call('GET','http://localhost/api.php/posts?include=categories,tags,comments&filter=id,eq,1', $csrf);
3232

3333
unlink($cookiejar);
3434

0 commit comments

Comments
 (0)