Skip to navigation
Simple php json post request
28.02.22
$url = 'http://foo.com/bar'; $data = ['code'=> $code, 'moq'=> $min_cust_order]; $options = array( 'http' => array( 'method' => 'POST', 'content' => json_encode( $data ), 'header'=> "Content-Type: application/json\r\n" . "Accept: application/json\r\n" ) ); $context = stream_context_create( $options ); $result = file_get_contents( $url, false, $context ); $response = json_decode( $result );
https://stackoverflow.com/questions/6213509/send-json-post-using-php
Reply
Anonymous
Information Epoch 1742536810
Save trees.
Home
Notebook
Contact us