Wecenter发送GET或POST请求

wecenter 文章 2020-01-20 21:37 1109 0 全屏看文

AI助手支持GPT4.0

HTTP请求
//GET请求
$res =  curl_get_contents($url, $timeout = 30)

//POST请求
$args = array(
	'client_id' => get_setting('sina_akey'),
	'client_secret' => get_setting('sina_skey'),
	'grant_type' => 'authorization_code',
	'code' => $this->authorization_code,
	'redirect_uri' => get_js_url($this->redirect_url)
);

$result = HTTP::request(self::OAUTH2_TOKEN_URL, 'POST', http_build_query($args));

if (!$result)
{
	$this->error_msg = AWS_APP::lang()->_t('获取 access token 时,与微博通信失败');

	return false;
}


-EOF-

AI助手支持GPT4.0