admin 发表于 2024-11-29 14:27:34

改造微擎ihttp_request函数增加请求头信息

代码:

function qiyecha($appcode, $keyword)
{
    load()->func('communication');
    $host = "https://businessfuzzy.shumaidata.com";
    $path = "/getbusinessfuzzy";
    $querys = "keyword=".urlencode($keyword);
    // 请求URL
    $url = $host . $path . "?" . $querys;
    // HTTP_HEADER
    $extra = array(
      "Authorization" => "APPCODE " . $appcode
    );
    $response = ihttp_request($url, '', $extra);
    return $response['content'];
}

页: [1]
查看完整版本: 改造微擎ihttp_request函数增加请求头信息