1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * Copyright (C) 2009, 2010 Red Hat, Inc.
4 * Copyright (C) 2010 Igalia, S.L.
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public License
17 * along with this library; see the file COPYING.LIB. If not, write to
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
22 #ifndef SOUP_REQUEST_H
23 #define SOUP_REQUEST_H 1
25 #ifdef LIBSOUP_USE_UNSTABLE_REQUEST_API
29 #include <libsoup/soup-types.h>
33 #define SOUP_TYPE_REQUEST (soup_request_get_type ())
34 #define SOUP_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SOUP_TYPE_REQUEST, SoupRequest))
35 #define SOUP_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SOUP_TYPE_REQUEST, SoupRequestClass))
36 #define SOUP_IS_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SOUP_TYPE_REQUEST))
37 #define SOUP_IS_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SOUP_TYPE_REQUEST))
38 #define SOUP_REQUEST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SOUP_TYPE_REQUEST, SoupRequestClass))
40 typedef struct _SoupRequest SoupRequest;
41 typedef struct _SoupRequestPrivate SoupRequestPrivate;
42 typedef struct _SoupRequestClass SoupRequestClass;
47 SoupRequestPrivate *priv;
50 struct _SoupRequestClass {
55 gboolean (*check_uri) (SoupRequest *req_base,
59 GInputStream * (*send) (SoupRequest *request,
60 GCancellable *cancellable,
62 void (*send_async) (SoupRequest *request,
63 GCancellable *cancellable,
64 GAsyncReadyCallback callback,
66 GInputStream * (*send_finish) (SoupRequest *request,
70 goffset (*get_content_length) (SoupRequest *request);
71 const char * (*get_content_type) (SoupRequest *request);
74 GType soup_request_get_type (void);
76 #define SOUP_REQUEST_URI "uri"
77 #define SOUP_REQUEST_SESSION "session"
79 GInputStream *soup_request_send (SoupRequest *request,
80 GCancellable *cancellable,
82 void soup_request_send_async (SoupRequest *request,
83 GCancellable *cancellable,
84 GAsyncReadyCallback callback,
86 GInputStream *soup_request_send_finish (SoupRequest *request,
90 SoupURI *soup_request_get_uri (SoupRequest *request);
91 SoupSession *soup_request_get_session (SoupRequest *request);
93 goffset soup_request_get_content_length (SoupRequest *request);
94 const char *soup_request_get_content_type (SoupRequest *request);
98 #endif /* LIBSOUP_USE_UNSTABLE_REQUEST_API */
100 #endif /* SOUP_REQUEST_H */