Skip to content

Commit 0153f52

Browse files
committed
Fix Basic auth example
1 parent 0a949a9 commit 0153f52

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

02_Advanced/02_Auth/01_Basic_Auth/curl-ext.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
curl_setopt_array($curlHandler, [
99
CURLOPT_URL => 'https://postman-echo.com/basic-auth',
1010
CURLOPT_RETURNTRANSFER => true,
11+
12+
CURLOPT_HTTPAUTH => CURLAUTH_BASIC,
1113
CURLOPT_USERPWD => $userName . ':' . $password,
1214
]);
1315

@@ -25,6 +27,7 @@
2527
curl_setopt_array($curlSecondHandler, [
2628
CURLOPT_URL => 'https://postman-echo.com/basic-auth',
2729
CURLOPT_RETURNTRANSFER => true,
30+
2831
CURLOPT_HTTPHEADER => [
2932
'Authorization: Basic ' . base64_encode($userName . ':' . $password)
3033
],

02_Advanced/02_Auth/02_Digest_Auth/curl-ext.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
curl_setopt_array($curlHandler, [
99
CURLOPT_URL => 'https://postman-echo.com/digest-auth',
1010
CURLOPT_RETURNTRANSFER => true,
11+
1112
CURLOPT_HTTPAUTH => CURLAUTH_DIGEST,
1213
CURLOPT_USERPWD => $userName . ':' . $password,
1314
]);

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1646,7 +1646,6 @@ print_r($response->getBody()->getContents());
16461646
- [ ] HTTP methods (HEAD, CONNECT, OPTIONS, TRACE)
16471647
- [ ] Cookies
16481648
- [ ] Proxy
1649-
- [ ] User agent
16501649
- [ ] Transfer progress
16511650
- [ ] Upload array of files in one POST field
16521651
- [ ] Upload/Download large files

0 commit comments

Comments
 (0)