File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
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
+ ```
You can’t perform that action at this time.
0 commit comments