public function request($requestURL,$params='',$method ='GET',$contentType='',$user=''){
$timeout = 30;
$ch = null;
if ('POST' === strtoupper($method)) {
$ch = curl_init($requestURL);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1);
curl_setopt($ch, CURLOPT_FORBID_REUSE, 1);
if (is_string($params)) {
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
} else {
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
}
} else if('GET' === strtoupper($method)) {
if(is_string($params)) {
$real_url = $requestURL. (strpos($requestURL, '?') === false ? '?' : ''). $params;
} else {
$real_ur
PHP框架调用Java后端,参数传递不过去的问题解决
最新推荐文章于 2022-08-26 16:14:53 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)