2 * @file sipe-http-request.h
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 /* Private interface between HTTP Public <-> Request <-> Transport layers */
25 #ifndef _SIPE_HTTP_PRIVATE_IF_REQUEST
26 #error "you are not allowed to include sipe-http-request.h!"
30 * Interface dependencies:
35 /* Forward declarations */
37 struct sipe_core_private
;
38 struct sipe_http_connection_public
;
39 struct sipe_http_request
;
41 struct sipe_http_parsed_uri
{
51 * @param uri text to parse
53 * @return pointer to parsed URI. Must be freed with @c sipe_http_parsed_uri_free()
55 struct sipe_http_parsed_uri
*sipe_http_parse_uri(const gchar
*uri
);
58 * Free parsed URI data structure
60 * @param pointer to parsed URI (may be @c NULL)
62 void sipe_http_parsed_uri_free(struct sipe_http_parsed_uri
*parsed_uri
);
66 * Is there pending request for HTTP connection?
68 * @param conn_public HTTP connection public data
70 gboolean
sipe_http_request_pending(struct sipe_http_connection_public
*conn_public
);
73 * HTTP connection is ready for next request
75 * @param conn_public HTTP connection public data
77 void sipe_http_request_next(struct sipe_http_connection_public
*conn_public
);
80 * HTTP response received
82 * @param conn_public HTTP connection public data
83 * @param msg parsed message
85 void sipe_http_request_response(struct sipe_http_connection_public
*conn_public
,
89 * HTTP connection shutdown
91 * @param conn_public HTTP connection public data
92 * @param abort @c TRUE if HTTP stack is shutting down
94 void sipe_http_request_shutdown(struct sipe_http_connection_public
*conn_public
,
98 * Create new HTTP request (internal raw version)
100 * @param sipe_private SIPE core private data
101 * @param parsed_uri pointer to parsed URI
102 * @param headers additional headers to add (may be @c NULL)
103 * @param body body (may be @c NULL)
104 * @param content_type MIME type for body (may be @c NULL if body is @c NULL)
105 * @param callback callback function
106 * @param callback_data callback data
108 * @return pointer to opaque HTTP request data structure
110 struct sipe_http_request
*sipe_http_request_new(struct sipe_core_private
*sipe_private
,
111 const struct sipe_http_parsed_uri
*parsed_uri
,
112 const gchar
*headers
,
114 const gchar
*content_type
,
115 sipe_http_response_callback
*callback
,
116 gpointer callback_data
);