http: implement first version of public API
[siplcs.git] / src / core / sipe-http.h
blobb35e4b66a31109806c5f2075356908d5cda72f27
1 /**
2 * @file sipe-http.h
4 * pidgin-sipe
6 * Copyright (C) 2013 SIPE Project <http://sipe.sourceforge.net/>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 /* Public interface to HTTP request service */
27 * Interface dependencies:
29 * <glib.h>
32 /* Forward declarations */
33 struct sipe_core_private;
34 struct sipe_http_request;
36 /**
37 * Free HTTP data
39 * @param sipe_private SIPE core private data
41 void sipe_http_free(struct sipe_core_private *sipe_private);
43 /**
44 * Cancel pending HTTP request
46 * @param pointer to opaque HTTP request data structure
48 void sipe_http_request_cancel(struct sipe_http_request *request);
50 /**
51 * Create HTTP GET request
53 * @param sipe_private SIPE core private data
54 * @param uri URI
55 * @param headers additional headers (may be @c NULL)
57 * @return pointer to opaque HTTP request data structure (@c NULL if failed)
59 struct sipe_http_request *sipe_http_request_get(struct sipe_core_private *sipe_private,
60 const gchar *uri,
61 const gchar *headers);
63 /**
64 * Create HTTP POST request
66 * @param sipe_private SIPE core private data
67 * @param uri URI
68 * @param headers additional headers (may be @c NULL)
69 * @param body body contents
70 * @param content_type body content type
72 * @return pointer to opaque HTTP request data structure (@c NULL if failed)
74 struct sipe_http_request *sipe_http_request_post(struct sipe_core_private *sipe_private,
75 const gchar *uri,
76 const gchar *headers,
77 const gchar *body,
78 const gchar *content_type);