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
{
50 * @param uri text to parse
52 * @return pointer to parsed URI. Must be freed with @c sipe_http_parsed_uri_free()
54 struct sipe_http_parsed_uri
*sipe_http_parse_uri(const gchar
*uri
);
57 * Free parsed URI data structure
59 * @param pointer to parsed URI.
61 void sipe_http_parsed_uri_free(struct sipe_http_parsed_uri
*parsed_uri
);
65 * Is there pending request for HTTP connection?
67 * @param conn_public HTTP connection public data
69 gboolean
sipe_http_request_pending(struct sipe_http_connection_public
*conn_public
);
72 * HTTP connection is ready for next request
74 * @param conn_public HTTP connection public data
76 void sipe_http_request_next(struct sipe_http_connection_public
*conn_public
);
79 * HTTP response received
81 * @param conn_public HTTP connection public data
82 * @param msg parsed message
84 void sipe_http_request_response(struct sipe_http_connection_public
*conn_public
,
88 * HTTP connection shutdown
90 * @param conn_public HTTP connection public data
92 void sipe_http_request_shutdown(struct sipe_http_connection_public
*conn_public
);
95 * Create new HTTP request (internal raw version)
97 * @param sipe_private SIPE core private data
98 * @param parsed_uri pointer to parsed URI
99 * @param headers additional headers to add (may be @c NULL)
100 * @param body body (may be @c NULL)
101 * @param content_type MIME type for body (may be @c NULL if body is @c NULL)
102 * @param callback callback function
103 * @param callback_data callback data
105 * @return pointer to opaque HTTP request data structure
107 struct sipe_http_request
*sipe_http_request_new(struct sipe_core_private
*sipe_private
,
108 const struct sipe_http_parsed_uri
*parsed_uri
,
109 const gchar
*headers
,
111 const gchar
*content_type
,
112 sipe_http_response_callback
*callback
,
113 gpointer callback_data
);