blob: ddee2adb699a6b069b77cfbe26b4d5a1621a6088 [file] [log] [blame]
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001/*
2 * http_client - HTTP client
3 * Copyright (c) 2009, Jouni Malinen <j@w1.fi>
4 *
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -08005 * This software may be distributed under the terms of the BSD license.
6 * See README for more details.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07007 */
8
9#ifndef HTTP_CLIENT_H
10#define HTTP_CLIENT_H
11
12struct http_client;
13
14enum http_client_event {
15 HTTP_CLIENT_FAILED,
16 HTTP_CLIENT_TIMEOUT,
17 HTTP_CLIENT_OK,
18 HTTP_CLIENT_INVALID_REPLY,
19};
20
21char * http_client_url_parse(const char *url, struct sockaddr_in *dst,
22 char **path);
23struct http_client * http_client_addr(struct sockaddr_in *dst,
24 struct wpabuf *req, size_t max_response,
25 void (*cb)(void *ctx,
26 struct http_client *c,
27 enum http_client_event event),
28 void *cb_ctx);
29struct http_client * http_client_url(const char *url,
30 struct wpabuf *req, size_t max_response,
31 void (*cb)(void *ctx,
32 struct http_client *c,
33 enum http_client_event event),
34 void *cb_ctx);
35void http_client_free(struct http_client *c);
36struct wpabuf * http_client_get_body(struct http_client *c);
37char * http_client_get_hdr_line(struct http_client *c, const char *tag);
38char * http_link_update(char *url, const char *base);
39
40#endif /* HTTP_CLIENT_H */