mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
Merge pull request #5880 from totoprayogo1916/docs-curl-lib
docs: add `literalinclude` for curlrequest -> debug
This commit is contained in:
commit
ae4f318922
@ -219,7 +219,7 @@ script execution. This is done by passing CURLOPT_VERBOSE and echoing the output
|
||||
server via ``spark serve`` you will see the output in the console. Otherwise, the output will be written to
|
||||
the server's error log.
|
||||
|
||||
$response->request('GET', 'http://example.com', ['debug' => true]);
|
||||
.. literalinclude:: curlrequest/034.php
|
||||
|
||||
You can pass a filename as the value for debug to have the output written to a file:
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
<?php
|
||||
|
||||
$response->request('GET', 'http://example.com', ['connect_timeout' => 0]);
|
||||
$client->request('GET', 'http://example.com', ['connect_timeout' => 0]);
|
||||
|
@ -1,3 +1,3 @@
|
||||
<?php
|
||||
|
||||
$response->request('GET', 'http://example.com', ['cookie' => WRITEPATH . 'CookieSaver.txt']);
|
||||
$client->request('GET', 'http://example.com', ['cookie' => WRITEPATH . 'CookieSaver.txt']);
|
||||
|
@ -1,3 +1,3 @@
|
||||
<?php
|
||||
|
||||
$response->request('GET', 'http://example.com', ['debug' => '/usr/local/curl_log.txt']);
|
||||
$client->request('GET', 'http://example.com', ['debug' => '/usr/local/curl_log.txt']);
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?php
|
||||
|
||||
// Delay for 2 seconds
|
||||
$response->request('GET', 'http://example.com', ['delay' => 2000]);
|
||||
$client->request('GET', 'http://example.com', ['delay' => 2000]);
|
||||
|
@ -1,3 +1,3 @@
|
||||
<?php
|
||||
|
||||
$response->request('GET', 'http://example.com', ['timeout' => 5]);
|
||||
$client->request('GET', 'http://example.com', ['timeout' => 5]);
|
||||
|
@ -1,3 +1,3 @@
|
||||
<?php
|
||||
|
||||
$response->request('GET', 'http://example.com', ['user_agent' => 'CodeIgniter Framework v4']);
|
||||
$client->request('GET', 'http://example.com', ['user_agent' => 'CodeIgniter Framework v4']);
|
||||
|
3
user_guide_src/source/libraries/curlrequest/034.php
Normal file
3
user_guide_src/source/libraries/curlrequest/034.php
Normal file
@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
$client->request('GET', 'http://example.com', ['debug' => true]);
|
Loading…
x
Reference in New Issue
Block a user