Skip to content
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

Swlib\Saber::create 时报错 #117

Open
weicut opened this issue Mar 1, 2021 · 2 comments
Open

Swlib\Saber::create 时报错 #117

weicut opened this issue Mar 1, 2021 · 2 comments

Comments

@weicut
Copy link

weicut commented Mar 1, 2021

$saber = Swlib\Saber::create([
//    'base_uri' => 'http://localhost:9988',
    'exception_report' => 0,
    'use_pool' => 50
]);


$result =  $saber->get('http://localhost:9988/', [
    'retry_time' => 3
]);

如果 create 时不加 base_uri,会报如下错误:

image

@twose
Copy link
Member

twose commented Mar 8, 2021

为什么要这么用呢 0.0

@weicut
Copy link
Author

weicut commented Mar 8, 2021

为什么要这么用呢 0.0

因为感觉在 get 方法中做会更友好,同样也可以根据 url 分析出 uri,不用强绑在实例中,Guzzle HTTP 组件也是采用这样的做法哦

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants