× {{alert.msg}} Never ask again
Get notified about new tutorials RECEIVE NEW TUTORIALS

Easy example for setting up a POST request through CURL

Stefan Doorn
Mar 10, 2015
<p>This example is always great when wanting to send a POST request through curl (e.g. communicating with an external REST API): http://davidwalsh.name/curl-post. </p> <p>It has some extra information how the concepts work, but also don't give too much information.</p> <p>All CURL options can be found here: http://php.net/manual/en/function.curl-setopt.php. And the appropriate CURL commands: http://php.net/manual/en/ref.curl.php.</p> <p>Always make sure you check HTTP return codes (e.g. if it's a 200 OK code) and make sure to use a secure connection whenever possible. Also specify timeouts if you want to return information to the client side in the same request.</p>
comments powered by Disqus