💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
## 发送POST请求 ~~~ use \api\Http; // 发送一个POST请求到http://127.0.0.1并且POST一些数据 // @param : API地址 // @param : POST的数据,可以是字符串或者是数组 // @param : 附加参数 $data = Http::post('http://127.0.0.1', [ 'id' => 1, 'name' => 'test' ]); // 自定义请求超时时间为10秒 $data = Http::post('http://127.0.0.1', [ 'id' => 1, 'name' => 'test' ], [ 'timeout' => 10 ]); // 在HEADER头中增加一个参数,name等于test $data = Http::post('http://127.0.0.1', [ 'id' => 1, 'name' => 'test' ], [ 'header' => [ 'name' => 'test' ] ]); // 完整参数示例 $data = Http::post('http://127.0.0.1', [ 'id' => 1, 'name' => 'test' ], [ // 请求参数列表 'query' => [ 'id' => 1 ], // 设置HEADER 'header' => [ 'name' => 'test' ], // 超时时间 'timeout' => 10 ]); ~~~