-
Notifications
You must be signed in to change notification settings - Fork 45
调试了一个晚上了,跟demo一模一样; #36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
是否额外设置了Curl的参数,或者限制了PHP无法访问tmp目录,可否把client初始化和发起POST请求的代码贴上来,我们结合情况定位下。 |
开发环境是alpine+swoole4.5+php7.4 |
调通了,按官方给的demo将body设为FnStream实例这种办法行不通,修改了下官方的jdk就跑通了;
添加multipartData 属性,让外部直接使用
客户端调用
|
通过header传进去的方式很多人提出过。我好奇的问题是,为什么现在的方法行不通呢?能否提供进一步的信息或者协助定位一下。 |
@TheNorthMemory swoole4.5.10 |
@miwei230 你可以试一下swoole4.6.0,今天刚release的,增加了native-curl(swoole/swoole-src#3863)支持,我刚用最新master(看 swoole/swoole-src@34d1db2 提交, 我的环境是 swoole/swoole-src@927a801:
|
升级到swoole4.6后就能跑通了。
|
针对这个我们更新下常见问题 |
已补充常见问题 |
始终报这个错:
GuzzleHttp\Exception\RequestException: cURL error 0: The cURL request was retried 3 times and did not succeed. The most likely reason for the failure is that cURL was
unable to rewind the body of the request and subsequent retries resulted in the same error. Turn on the debug option to see what went wrong. See https://bugs.php.net
/bug.php?id=47204 for more information. (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)
/opt/www/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:201
/opt/www/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:537
/opt/www/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:152
/opt/www/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:105
/opt/www/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php:43
/opt/www/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:542
/opt/www/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:152
/opt/www/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:105
/opt/www/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php:43
/opt/www/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:542
/opt/www/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:152
/opt/www/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:105
/opt/www/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php:43
/opt/www/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php:28
/opt/www/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php:51
报文:
POST /v3/merchant/media/upload HTTP/1.1
Transfer-Encoding: chunked
Expect: 100-Continue
Host: api.mch.weixin.qq.com
Accept: application/json
content-type: multipart/form-data; boundary=6670df4d7516317f8c24338c2473dbaa569479be
Authorization: WECHATPAY2-SHA256-RSA2048 mchid="1604972733",nonce_str="SMC0WV5GqQsRid60TUeVYhzavr9ynT7H",timestamp="1609336633",serial_no="4A8E836B052723A58ACD2EE725102CF70100FDA4",signature="DYHnKqXnQVRJCTnxdXiEvLSzquvKsHfM6j9HkqLG2XMxG10wsXyi06kXSQ9E37O7jz1tjuyBoRc6d2UmUHW3dZ59orblFX1b42uwKO21zaUjRKtgkGbIQ0DgIs4r9JHY7bsmetp8oFc/iCvWwxcVZgy5M91dEzSSgTCyw3w4bzICqB/Gz/oLK4dbtaVlj6ceG/jYq/7/l8PkZuACz9OTJaGdRAVs7cpn8UMU6KeAUNpmodQFhmECDOoF/GlLd6XMmE4kjczaf1Kj2gsOH1cKae1Mqw2ennSqiCg/4+oExevLeiYuoEi2Q8uv9JLpHrEhqN4sG23ArlsIs7ZNvyyy2g=="
User-Agent: WechatPay-Guzzle/0.2.0 GuzzleHttp/6.5.5 curl/7.66.0 (Linux/4.19.76-linuxkit) PHP/7.4.13
使用postman或其他工具都有返回值,唯有这个guzzle 报错。
The text was updated successfully, but these errors were encountered: