saber icon indicating copy to clipboard operation
saber copied to clipboard

⚔️ Saber, PHP异步协程HTTP客户端 | PHP Coroutine HTTP client - Swoole Humanization Library

Results 30 saber issues
Sort by recently updated
recently updated
newest added

…… $url = "https://apis.map.qq.com/ws/geocoder/v1/?location={$lat},{$lng}&key={$key}&get_poi={$get_poi}"; $response = SaberGM::get($url); $response->getBoay()->getContents();乱码 PHP 8.1.2 (cli) [PHP Modules] > bcmath > calendar > Core > ctype > curl > date > dom > exif >...

最近打算使用saber来作为twitter api 的客户端,发现saber会自动对url进行转码.导致api请求失败. 经过测试发现: 使用 `SaberGM::get("http://127.0.0.1/r.php?max_results=10&tweet.fields=lang,created_at,entities&expansions=attachments.media_keys&media.fields=type,preview_image_url,url");` 服务端接收到经过转码的QUERY_STRING: `[QUERY_STRING] => max_results=10&tweet_fields=lang%2Ccreated_at%2Centities&expansions=attachments.media_keys&media_fields=type%2Cpreview_image_url%2Curl` 而用curl 发送请求: `curl "http://127.0.0.1/r.php?max_results=10&tweet.fields=lang,created_at,entities&expansions=attachments.media_keys&media.fields=type,preview_image_url,url"` 服务端能接收到正确的QUERY_STRING: `[QUERY_STRING] => max_results=10&tweet.fields=lang,created_at,entities&expansions=attachments.media_keys&media.fields=type,preview_image_url,url` 请问如何禁止saber对url自动转码?

设置了retry_time和max_co的时候,触发重试会报错"You can't enqueue a waiting request when using the max concurrency control!". 最小化代码: ```php

### 问题描述 在使用http客户端下载文件时, 对端返回的http status code 为 419. 测试后发现下载文件的请求头中包含了 Range 但是为空. 示例: ```text Host: 192.168.8.52 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8 Accept-Encoding: gzip User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like...

bug

![image](https://user-images.githubusercontent.com/6057923/134780517-7ecd342c-7ab9-4a95-98a8-f04d78ae3a13.png) $kvs = explode(';', $header); // 需要去除";"后的空格,因为有些服务设置cookie没有在分号后追加空格 $cookie['value'] = str_replace(['\'\'', '""'], '', trim($nv[1])); // 去除首位空格 $kv = explode('=', trim($kv)); // 同上

正确响应的情况 ``` $ch = curl_init(); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_URL, 'https://fees.uspto.gov/mntfee-services/v1/maintenancefee/details?patentNumber=8690232&applicationNumber=13869358'); curl_setopt($ch, CURLOPT_COOKIEJAR, getcwd() . "/cookies.txt"); curl_setopt($ch, CURLOPT_COOKIEFILE, getcwd() . "/cookies.txt"); $result = curl_exec($ch); dump($result); ``` 未能正确响应...

拦截器里能实现吗?

浏览器地址栏请求 http://127.0.0.1:9501/index?q2-303030003300-q.904+11.1b 服务器打印 当前的请求的 query_string 为,正常的,地址没有变化 ![image](https://user-images.githubusercontent.com/18624879/122004062-7db33200-cde6-11eb-8813-2d60d659ce47.png) 使用saber请求,会变成 q2-303030003300-q_904_11_1b= ![image](https://user-images.githubusercontent.com/18624879/122004115-928fc580-cde6-11eb-92d0-dced50564cdf.png)

enhancement

首先下面是我的调试的代码: ```php echo SaberGM::post('https://oapi.dingtalk.com/media/upload?access_token=xxxx', [ 'type' => 'file' ], [ 'headers' => [ 'Accept-Encoding' => null ], // 'content_type' => null, 'files' => [ 'media' => alias("@runtime/") . '../phpunit.txt', ]...

in progress

Swlib\Saber\Request 的接口很丰富,Swlib\Saber\WebSocket的接口却很少

question