http_fetch(3)

http_fetch3

Downloads a file via http.

Usage

#include <http_fetcher.h>

int http_fetch(const char *url, char **fileBuf);

Overview

Download the file located at url. Memory is allocated to hold the file, and is pointed to by fileBuf.

If you pass NULL for fileBuf, url will be requested but will not remain in memory (useful for simply registering a hit).

Return value

On success, http_fetch returns the number of bytes of data downloaded (HTTP metadata not included).

On error, -1 is returned, and http_perror can be used to print an informative error message. http_strerror can be used to get a pointer to the current error description message.

Releases

Unchanged in 2 releases since Debian 3.0 (Woody).

  1. 3.0–3.1

From libhttpfetcher-dev 1.0.1-3 in Debian 3.1 (Sarge). Parsed by carta from the page's man source.