0

I know how to implement a server with Mongoose, in fact all information that I could find was about servers, but I need to know how do I implement a client.

Very basic, how to connect to a server is the main problem, the send functions are pretty straight forward.

2 Answers 2

1

Mongoose is a web server and AFAIK does not provide an API for client side http requests.

For C++ http client libraries, you might want to look at these answers:

These sites also give a good overview about available C++ client libraries:

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, sorry for the late reply, I was trying to avoid adding more libraries, I figured out that I could live just sending responses (thus not requiring client code). But I'll keep your suggestions for when I need an http client, thanks.
1

Mongoose actually does provide HTTP client functionality. See mg_connect() on http://cesanta.com/docs/API.shtml. Also, example HTTP client code is at https://github.com/cesanta/mongoose/tree/master/examples/http_client

I suggest using Fossa library (a superset of Mongoose), as it's HTTP client interface is more flexible. Example code is at https://github.com/cesanta/fossa/tree/master/examples/restful_client , documentation is at http://cesanta.com/docs/fossa/

2 Comments

Alas, it appears as though Fossa development has stopped about the same time as you wrote this. For the past few years, only Mongoose has been improved.
Yeah, cause Fossa became Mongoose.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.