国内综合精彩aⅤ无码不卡_日本少妇做爰全过程_欧美性爱在线播放免费_午夜?V日韩一区二区_免费a级毛片无码免费播放_成在人线av无码喷水_亚洲精品网站色视频_国产婷婷精品成人_老师撩起裙子让我桶的视频_秋霞影院国产

分享一個HTTPS的用到的PHP POST請求函數(shù)

作者:hzcwd | 更新時間:2019-01-23 | 瀏覽量:1349


 

/*
$url:地址
$param:參數(shù)(數(shù)組)
 */
function send_post($url, $param) {
  $options = array(
    'http' => array(
      'method' => 'POST',
      'header' => 'Content-type:application/x-www-form-urlencoded',
      'content' => http_build_query($param),
      'timeout' => 5
    )
  );
  $context = stream_context_create($options);
  $result = file_get_contents($url, false, $context);
  return $result;
}


使用方法:

$url = 'http://m.placeboworld.cn/oauth/token';

$param['grant_type'] = 'password';
$param['client_id'] = '111';
$param['client_secret'] = '1234';
$param['username'] = '123';
$param['password'] = '123';
$rs = send_post($url,$param);


評論:共1條

貝殼物聯(lián) 評論于:2019-01-24 09:41:59
多謝分享!
返回頂部