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.

DrStein
  • 75
  • 2
  • 13

2 Answers2

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:

Community
  • 1
  • 1
Sascha
  • 1,104
  • 8
  • 15
  • 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. – DrStein Mar 24 '14 at 19:29
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/

valenok
  • 827
  • 7
  • 9
  • 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. – rdtsc Feb 24 '17 at 20:13
  • Yeah, cause Fossa became Mongoose. – valenok Feb 24 '17 at 23:55