Quantcast
Channel: michael f1337 » code
Viewing all articles
Browse latest Browse all 9

Debugging PHP + cURL Using Charles Proxy

$
0
0

To debug/inspect cURL requests and responses in PHP, proxy the requests through an HTTP proxy like Charles:

curl_setopt($ch, CURLOPT_PROXY, "127.0.0.1");
curl_setopt($ch, CURLOPT_PROXYPORT, 8888);

To avoid certificate trust errors, disable SSL certificate verification in your development environment (do not disable in production environments!):

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

via Charles Documentation.


Viewing all articles
Browse latest Browse all 9

Trending Articles