Skip to content

Commit 20d5b69

Browse files
committed
Fix php-curl-class#36: Add example of case-insensitive access to headers
1 parent 88ba4b2 commit 20d5b69

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,14 @@ $curl->setOpt(CURLOPT_ENCODING , 'gzip');
8787
$curl->get('https://www.example.com/image.png');
8888
```
8989

90+
```php
91+
// Case-insensitive access to headers.
92+
$curl = new Curl();
93+
$curl->get('https://www.example.com/image.png');
94+
echo $curl->response_headers['Content-Type'] . "\n"; // image/png
95+
echo $curl->response_headers['CoNTeNT-TYPE'] . "\n"; // image/png
96+
```
97+
9098
```php
9199
$curl->close();
92100
```

0 commit comments

Comments
 (0)