- 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);
- x-www-form-urlencode(from)传参```php$data = array()$postdata = http_build_query($data);$opts = array( 'http' =>array( 'method' => 'POST', 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => $postdata ));$context = stream_context_create($opts);return file_get_contents($url, false, $context);