Enter your email address to subscribe to this blog and receive notifications of new posts by email.
Join 1 other subscriber
Email Address
Questions
274
Members
7946
How to post request without curl
Satya Prakash`
i have used file_get_contents().
The PHP manual has a nice example here. This is just copy past from the manual:
$postdata = http_build_query( array( 'var1' => 'some content', 'var2' => 'doh' ) ); $opts = array('http' => array( 'method' => 'POST', 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => $postdata ) ); $context = stream_context_create($opts); $result = file_get_contents('http://example.com/submit.php', false, $context);
By clicking "Sign up" you indicate that you have read and agree to the privacy policy and terms of service.
Satya Prakash`
i have used file_get_contents().
The PHP manual has a nice example here. This is just copy past from the manual:
$postdata = http_build_query( array( 'var1' => 'some content', 'var2' => 'doh' ) ); $opts = array('http' => array( 'method' => 'POST', 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => $postdata ) ); $context = stream_context_create($opts); $result = file_get_contents('http://example.com/submit.php', false, $context);
Related