Added mg_connect(), mg_fetch() API functions. More tests added

This commit is contained in:
Sergey Lyubka committed 2012-07-28 11:04:03 +01:00
1 parent da75a62a32
commit 6c54370aa1
4 files changed
+208 -46

No files matched your search

+20
View File
@@ -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);