• json传参 ```php $options[ ‘http’ ] = array( ‘timeout’ => 5, ‘method’ => ‘POST’, ‘header’ => “Content-Type:application/json;charset=utf-8”, ‘content’ => $this->ipMeetInfo, ); $context = stream_context_create($options); $file_contents = file_get_contents($url, false, $context);
    1. - x-www-form-urlencode(from)传参
    2. ```php
    3. $data = array()
    4. $postdata = http_build_query($data);
    5. $opts = array(
    6. 'http' =>array(
    7. 'method' => 'POST',
    8. 'header' => 'Content-type: application/x-www-form-urlencoded',
    9. 'content' => $postdata
    10. )
    11. );
    12. $context = stream_context_create($opts);
    13. return file_get_contents($url, false, $context);