{"id":776,"date":"2010-07-14T01:31:07","date_gmt":"2010-07-14T01:31:07","guid":{"rendered":"http:\/\/www.phpmind.com\/blog\/?p=776"},"modified":"2010-07-17T01:35:43","modified_gmt":"2010-07-17T01:35:43","slug":"how-to-test-https-curl-in-development-server","status":"publish","type":"post","link":"https:\/\/www.phpmind.com\/blog\/2010\/07\/how-to-test-https-curl-in-development-server\/","title":{"rendered":"How to test HTTPS CURL in development server?"},"content":{"rendered":"<p>HTTPS is secure HTTP communication based on SSL protocol (HTTP over SSL). Generally all sensitive info (like passwords, financial details, etc.) are sent over this transport. Common example: your gmail login is done through HTTPS channel and different payment gateway.<br \/>\nSo here in this deal &#8211;<\/p>\n<pre lang=\"php\">$postfields = array('field1'=&gt;'value1', 'field2'=&gt;'value2');\r\n$ch = curl_init();\r\ncurl_setopt($ch, CURLOPT_URL, 'https:\/\/foo.com');\r\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\ncurl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\r\ncurl_setopt($ch, CURLOPT_POST, 1);\r\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $postFields);\r\ncurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\r\n$result = curl_exec($ch);\r\n<\/pre>\n<p>CURLOPT_SSL_VERIFYHOST is off. This allows you to test the CURL in your dev server without having HTTPS. PHP\/Curl will handle the http request.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>HTTPS is secure HTTP communication based on SSL protocol (HTTP over SSL). Generally all sensitive info (like passwords, financial details, etc.) are sent over this transport. Common example: your gmail login is done through HTTPS channel and different payment gateway. So here in this deal &#8211; $postfields = array(&#8216;field1&#8217;=&gt;&#8217;value1&#8217;, &#8216;field2&#8217;=&gt;&#8217;value2&#8217;); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[29],"tags":[],"class_list":["post-776","post","type-post","status-publish","format-standard","hentry","category-curl"],"_links":{"self":[{"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/posts\/776","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/comments?post=776"}],"version-history":[{"count":4,"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/posts\/776\/revisions"}],"predecessor-version":[{"id":778,"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/posts\/776\/revisions\/778"}],"wp:attachment":[{"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/media?parent=776"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/categories?post=776"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/tags?post=776"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}