Skip to content

Commit 1be886c

Browse files
committed
Add troubleshooting doc
1 parent 7fdccc7 commit 1be886c

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

TROUBLESHOOTING.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Troubleshooting
2+
3+
### Turn on verbose mode
4+
5+
```php
6+
$curl = new Curl();
7+
$curl->verbose();
8+
```
9+
10+
### Compare output with and without the library
11+
12+
```php
13+
$curl = new Curl();
14+
$curl->get('https://www.example.com/');
15+
var_dump($curl);
16+
```
17+
18+
```php
19+
$ch = curl_init();
20+
curl_setopt($ch, CURLINFO_HEADER_OUT, true);
21+
curl_setopt($ch, CURLOPT_HEADER, false);
22+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
23+
curl_setopt($ch, CURLOPT_URL, 'https://www.example.com/');
24+
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
25+
curl_setopt($ch, CURLOPT_HTTPGET, true);
26+
$raw_response = curl_exec($ch);
27+
$curl_error_code = curl_errno($ch);
28+
$curl_error_message = curl_error($ch);
29+
$http_status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
30+
$request_headers = curl_getinfo($ch, CURLINFO_HEADER_OUT);
31+
```

0 commit comments

Comments
 (0)