Debugging
Previously mentioned in the last section on handling headers, the cu rl_getinfo function also enables you to view requests being sent by cURL. This can be quite useful when debugging. Below is an example of this feature in action. <?php $ch = curl_init(); curl_setopt_array(array( CURLOPT_RETURNTRANSFER => true, CURLINFO_HEADER_OUT => true )); curl_exec($ch); $request = curl_getinfo($ch, CURLINFO_HEADER_OUT); ?>
© cURL Extension — Web Scraping >>> Back to TABLE OF CONTENTS <<< | |
Views: 413 | |
Total comments: 0 | |