extern char *http_server;
extern int http_port;
extern char *http_proxy_server;
extern int http_proxy_port;
http_retcode http_put
(
char *filename,
char *data,
int length,
int overwrite,
char *type
);
http_retcode http_get
(
char *filename,
char **pdata,
int *plength,
char *typebuf
);
http_retcode http_head
(
char *filename,
int *plength,
char *typebuf
);
http_retcode http_delete(char *filename);
http_retcode http_parse_url
(
char *url,
char **pfilename
);
char *data
Pointer to the data to send.
int length
Length of the data to send.
int overwrite
Flag to request to overwrite the ressource if it was already
existing.
char *type
Type of the data, if NULL default type is used.
char *filename (http_get)
Name of the ressource to read.
char **pdata
Address of a pointer variable which will be set to point toward
allocated memory containing read data.
char *url
Writeable copy of an url.
char **pfilename
Address of a pointer that will be filled with allocated filename
the pointer must be equal to NULL before calling or it will be
automatically freed (free(3)).
http_port
Server port number.
http_proxy_server
Pointer a string containing proxy server name to use or NULL for noproxy.
http_port
Proxy server port number (or 0).
http_put
Put data on the server
This function sends data to the http data server. The data will be stored under the ressource name filename.
http_get
Get data from the server
This function gets data from the http data server. The data is read from the ressource named filename. Address of new new allocated memory block is filled in pdata whose length is returned via plength.
http_head
Request the header
This function outputs the header of thehttp data server. The header is from the ressource named filename. The length and type of data is eventually returned (like for http_get(3)).
http_delete
Delete data on the server
This function request a DELETE on the http data server.
http_parse_url
Parses an url : setting the http_server and http_port global variables
and returning the filename to pass to http_get/put/...
http_get
A negative error code or a positive code from the server.
http_head
A negative error code or a positive code from the server.
http_delete
A negative error code or a positive code from the server.
http_parse_url
A negative error code or 0 if sucessfully parsed.
Possible values for a http_retcode are as follows:
Client side errors.
ERRHOST No such host.
ERRSOCK Can't create socket.
ERRCONN Can't connect to host.
ERRWRHD Write error on socket while writing header.
ERRWRDT Write error on socket while writing data.
ERRRDHD Read error on socket while reading result.
ERRPAHD Invalid answer from data server.
ERRNULL Null data pointer.
ERRNOLG No/Bad length in header.
http_get
Filename is truncated to first 256 characters.
http_head
Filename is truncated to first 256 characters.
http_delete
Filename is truncated to first 256 characters.