1 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
18 @warning : This file contains Rose Model ID comments - please do not delete
21 #ifndef __RHTTPMESSAGE_H__
22 #define __RHTTPMESSAGE_H__
24 // Forward declarations
26 class MHTTPDataSupplier;
30 //##ModelId=3A375D1F0377
33 An abstract HTTP message. In RFC2616, an HTTP message is defined as having a
34 header and an optional body. This class is specialised for HTTP requests and
41 // Default (uninitialised) constructor.
42 //##ModelId=3A375DD60140
43 inline RHTTPMessage();
45 /** Returns the header collection for the message */
46 //##ModelId=3A375DDE0368
47 IMPORT_C RHTTPHeaders GetHeaderCollection();
49 /** Sets the messages body, replacing any existing body. The body
50 is supplied as a MHTTPDataSupplier, which will then return the
51 data in 1 or more chunks on request.
52 @param aBody The data supplier that will supply the body. */
53 //##ModelId=3A375DE0019E
54 IMPORT_C void SetBody(MHTTPDataSupplier& aBody);
56 /** Removes the body */
57 //##ModelId=3B1E66FF004E
58 IMPORT_C void RemoveBody();
60 /** Determine whether this message has any associated body data.
61 @return ETrue if there is some body data, EFalse if not.
63 //##ModelId=3A914DFF01E5
64 IMPORT_C TBool HasBody() const;
66 /** Gets the body. The body is supplied as a MHTTPDataSupplier,
67 which can be used to return the current data chunk, and to
68 acknowledge when that chunk has been consumed by the client.
70 Note that the client can assume the body object will remain
71 unchanged from when it receives the first data until the end
74 @return A data supplier that provides access to a body
75 data chunk. NULL if the body has not been set, or has been removed */
76 //##ModelId=3A375DE40190
77 IMPORT_C MHTTPDataSupplier* Body() const;
80 //##ModelId=3A914DFF01C7
81 CMessage* iImplementation;
85 inline RHTTPMessage::RHTTPMessage()
86 : iImplementation(NULL)
91 #endif // __RHTTPMESSAGE_H__