-
Notifications
You must be signed in to change notification settings - Fork 312
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
feat(http): implement http client based on libcurl #1583
Conversation
I recommend this library for more modern http https://github.com/yhirose/cpp-httplib |
Thanks for your recommendation ! It seems that this lib provides a set of very elegant and easy-to-use APIs for http client. In addition, it also supports building http server. Later on I'll look deep into this lib. |
+1, it's not necessary to invent the wheel again :) |
ca0f8fd
to
146d894
Compare
Originally, referencing libcurl into pegasus shell directly would lead to hidden symbol XXX in YYY is referenced by DSO ...: This error could be eliminated by introducing http client. However, compilation failed for macOS:
Then after libcurl was bumped to 8.3.0 from 7.47.0, compilation failed for ubuntu:
compilation also failed for macOS:
Therefore, libcurl is built with
|
const dsn::error_s &err) | ||
{ | ||
const std::string actual_description(err.description()); | ||
std::cout << actual_description << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the output for debuging? If you want to check what the actual value is when test failed, you can use the macro like this:
ASSERT_*(x,x) << actual_description;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason why this description is printed is that its postfix, i.e. msg
field, as is described above, differ in various systems. I think the different message could be shown for each various system.
#1582
Http client is implemented based on libcurl. Both GET and POST methods
are supported.