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

关于hv::HttpClient::send的返回值问题? #678

Open
monk1magic opened this issue Feb 7, 2025 · 2 comments
Open

关于hv::HttpClient::send的返回值问题? #678

monk1magic opened this issue Feb 7, 2025 · 2 comments

Comments

@monk1magic
Copy link

某些情况下调用下面函数:

// sync
int send(HttpRequest* req, HttpResponse* resp) {
return http_client_send(_client, req, resp);
}

返回值不是0(比如1100这种正整数),但是resp.status_code的值是200,这种情况下是否依然可以视为调用成功??

@ithewei
Copy link
Owner

ithewei commented Feb 7, 2025

不可以,需要先判断返回值,HttpResponse的status_code默认值就是200

@monk1magic
Copy link
Author

感谢

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