1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * Authors: Jeffrey Stedfast <fejj@ximian.com>
5 * Copyright 2002 Ximian, Inc. (www.ximian.com)
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 #ifndef __CAMEL_HTTP_STREAM_H__
25 #define __CAMEL_HTTP_STREAM_H__
27 #include <camel/camel-mime-parser.h>
28 #include <camel/camel-mime-utils.h>
29 #include <camel/camel-stream.h>
30 #include <camel/camel-url.h>
32 #define CAMEL_HTTP_STREAM_TYPE (camel_http_stream_get_type ())
33 #define CAMEL_HTTP_STREAM(obj) (CAMEL_CHECK_CAST((obj), CAMEL_HTTP_STREAM_TYPE, CamelHttpStream))
34 #define CAMEL_HTTP_STREAM_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_HTTP_STREAM_TYPE, CamelHttpStreamClass))
35 #define CAMEL_IS_HTTP_STREAM(o) (CAMEL_CHECK_TYPE((o), CAMEL_HTTP_STREAM_TYPE))
40 /*CAMEL_HTTP_METHOD_OPTIONS,*/
41 CAMEL_HTTP_METHOD_GET,
42 CAMEL_HTTP_METHOD_HEAD,
43 /*CAMEL_HTTP_METHOD_POST,*/
44 /*CAMEL_HTTP_METHOD_PUT,*/
45 /*CAMEL_HTTP_METHOD_DELETE,*/
46 /*CAMEL_HTTP_METHOD_TRACE,*/
47 /*CAMEL_HTTP_METHOD_CONNECT*/
51 typedef struct _CamelHttpStreamClass CamelHttpStreamClass;
53 struct _CamelHttpStream {
54 CamelStream parent_object;
56 CamelMimeParser *parser;
58 CamelContentType *content_type;
59 struct _camel_header_raw *headers;
61 CamelHttpMethod method;
62 struct _CamelSession *session;
78 struct _CamelHttpStreamClass {
79 CamelStreamClass parent_class;
84 /* Standard Camel function */
85 CamelType camel_http_stream_get_type (void);
88 CamelStream *camel_http_stream_new (CamelHttpMethod method, struct _CamelSession *session, CamelURL *url);
90 void camel_http_stream_set_user_agent (CamelHttpStream *http_stream, const char *user_agent);
92 void camel_http_stream_set_proxy (CamelHttpStream *http_stream, const char *proxy_url);
93 void camel_http_stream_set_proxy_authrealm (CamelHttpStream *http_stream, const char *proxy_authrealm);
94 void camel_http_stream_set_proxy_authpass (CamelHttpStream *http_stream, const char *proxy_authpass);
96 CamelContentType *camel_http_stream_get_content_type (CamelHttpStream *http_stream);
100 #endif /* __CAMEL_HTTP_STREAM_H__ */