|
|
|
Location:
http\rhttpheaders.h
Link against: http.lib
class RHTTPHeaders
Supported from 7.0
A collection of header fields associated with a message.
Header fields can be created, read and modified. They may be composed of several parts (by repeated invocations of API methods, see below) and may be assigned one or more parameters. Individual field parts and parameters take values described using THTTPHdrVal.
Defined in RHTTPHeaders:
FieldPartsL(), Fields(), GetField(), GetParam(), GetRawField(), RHTTPHeaders(), RemoveAllFields(), RemoveField(), RemoveFieldPart(), SetFieldL(), SetFieldL(), SetParamL(), SetRawFieldL(), iImplementation
TInt FieldPartsL(RStringF aFieldName) const;
Gets the number of parts in the named header field's value.
Simple headers are created with a single part following one call to SetFieldL().
Subsequent calls to SetFieldL() create additional parts if the field exists already.
|
|
TInt GetField(RStringF aFieldName, TInt aPartIdx, THTTPHdrVal& aHeaderValue) const;
Gets the named header field's value.
The index of a part within the field must be specified. Parts are indexed from 0. Fields with only one part return the entire field for index 0.
|
|
TInt GetRawField(RStringF aFieldName, TPtrC8& aRawFieldData) const;
Gets a raw representation of the named header field's value.
Note that client use of this method is strongly discouraged since it exposes the raw representation of particular headers. However, it may be needed for some cases where received headers could not be decoded by HTTP. It is normally used internally when preparing header data to be transmitted with a request.
|
|
TInt GetParam(RStringF aFieldName, RStringF aParamName, THTTPHdrVal& aReturn, TInt aPartIdx=0) const;
Gets the value of a named parameter, associated with the named header field.
|
|
THTTPHdrFieldIter Fields() const;
Gets an iterator for the header fields.
Each application of the iterator returns the name of the next field type. This may then be accessed through GetField().
|
void SetFieldL(RStringF aFieldName, THTTPHdrVal aFieldValue);
Sets a named field in the header.
On the first instance that this API method is used for a given field name, the field will be created. On subsequent calls, the same field will be extended to have several parts, with a new part created to hold the supplied value.
|
void SetFieldL(RStringF aFieldName, THTTPHdrVal aFieldValue, RStringF aParamName, THTTPHdrVal aParamValue);
Sets a named field in the header, and associates the supplied parameter with it.
If the field doesn't already exist, it will be created with a parameter; if it does exist, then a new part will be created with the parameter.
|
void SetParamL(RStringF aFieldName, RStringF aParamName, THTTPHdrVal aParamValue, TInt aPartIdx);
Set a parameter in an existing field.
|
|
void SetRawFieldL(RStringF aFieldName, const TDesC8& aRawFieldData);
Set a named field in the header to contain the supplied raw header data.
If the header already exists then a LF and the new data will be added to the existing data. This is used to indicate that there are multiple instances of this header.
Note that general client use of this method is strongly discouraged since it exposes the raw representation of particular headers. However it may be needed for some cases where HTTP could not locate an encoder that could handle the header. It is normally used internally when encoding request headers supplied by a client.
|
TInt RemoveField(RStringF aFieldName);
Removes, entirely, the named header field from the header collection.
All its parts and associated parameters, where they exist, are also removed.
|
|
TInt RemoveFieldPart(RStringF aFieldName, TInt aIndex);
Removes a single part of a header field.
Only the part and any associated parameters are removed. If this results in no parts being present in the header field, then it will also be removed
|
|
private: CHeaders* iImplementation;
This is internal and not intended for use.