mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-08 16:11:18 +00:00
Added mg_connect(), mg_fetch() API functions. More tests added
This commit is contained in:
1 parent
da75a62a32
commit
6c54370aa1
4 files changed
+208
-46
No files matched your search
+20
@@ -218,6 +218,26 @@ int mg_get_cookie(const struct mg_connection *,
|
||||
const char *cookie_name, char *buf, size_t buf_len);
|
||||
|
||||
|
||||
// Connect to the remote web server.
|
||||
// Return:
|
||||
// On success, valid pointer to the new connection
|
||||
// On error, NULL
|
||||
struct mg_connection *mg_connect(struct mg_context *ctx,
|
||||
const char *host, int port, int use_ssl);
|
||||
|
||||
|
||||
// Download given URL to a given file.
|
||||
// url: URL to download
|
||||
// path: file name where to save the data
|
||||
// request_info: pointer to a structure that will hold parsed reply headers
|
||||
// Return:
|
||||
// On success, opened file stream to the downloaded contents. The stream
|
||||
// is positioned to the end of the file.
|
||||
// On error, NULL
|
||||
FILE *mg_fetch(struct mg_context *ctx, const char *url, const char *path,
|
||||
struct mg_request_info *request_info);
|
||||
|
||||
|
||||
// Return Mongoose version.
|
||||
const char *mg_version(void);
|
||||
|
||||
|
||||
Reference in new issue
Block a user