2 * Copyright (C) 2011-2012 Juho Vähä-Herttua
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
15 #ifndef HTTP_REQUEST_H
16 #define HTTP_REQUEST_H
18 typedef struct http_request_s http_request_t
;
21 http_request_t
*http_request_init(void);
23 int http_request_add_data(http_request_t
*request
, const char *data
, int datalen
);
24 int http_request_is_complete(http_request_t
*request
);
25 int http_request_has_error(http_request_t
*request
);
27 const char *http_request_get_error_name(http_request_t
*request
);
28 const char *http_request_get_error_description(http_request_t
*request
);
29 const char *http_request_get_method(http_request_t
*request
);
30 const char *http_request_get_url(http_request_t
*request
);
31 const char *http_request_get_header(http_request_t
*request
, const char *name
);
32 const char *http_request_get_data(http_request_t
*request
, int *datalen
);
34 void http_request_destroy(http_request_t
*request
);