2 * Copyright 2004-2005 Timo Hirvonen
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of the
7 * License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
28 * 1xx indicates an informational message only
29 * 2xx indicates success of some kind
30 * 3xx redirects the client to another URL
31 * 4xx indicates an error on the client's part
32 * 5xx indicates an error on the server's part
46 struct keyval
*headers
;
51 int http_parse_uri(const char *uri
, struct http_uri
*u
);
53 /* frees contents of @u, not @u itself */
54 void http_free_uri(struct http_uri
*u
);
56 int http_open(struct http_get
*hg
, int timeout_ms
);
63 int http_get(struct http_get
*hg
, struct keyval
*headers
, int timeout_ms
);
64 void http_get_free(struct http_get
*hg
);
66 char *http_read_body(int fd
, size_t *size
, int timeout_ms
);
67 char *base64_encode(const char *str
);