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

服务器返回404等状态码时怎么接收? #9

Open
Ives88 opened this issue Sep 8, 2020 · 4 comments
Open

服务器返回404等状态码时怎么接收? #9

Ives88 opened this issue Sep 8, 2020 · 4 comments

Comments

@Ives88
Copy link

Ives88 commented Sep 8, 2020

这个库都是用string来接收正常请求后的响应数据,但如果服务器404或者500时这个string是空的,那怎么获取到这些错误码和异常信息呢?

@JelinYao
Copy link
Owner

JelinYao commented Sep 8, 2020

image
404的时候会抛出一个异常HttpError404,通过接口获取errorcode即可。
virtual HttpInterfaceError GetErrorCode() { return m_paramsData.errcode; }

@Ives88
Copy link
Author

Ives88 commented Sep 8, 2020

image
404的时候会抛出一个异常HttpError404,通过接口获取errorcode即可。
virtual HttpInterfaceError GetErrorCode() { return m_paramsData.errcode; }

但这个值打印出来为什么是3?不大对?

@Ives88
Copy link
Author

Ives88 commented Sep 9, 2020

域名乱填就报3,path乱填虽然404,但不会走到这,因为body是不为空的。 @JelinYao

@fengshangren
Copy link

怎么用VS 2017编译成静态库调用啊,编译很多错误

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

3 participants