MessageHeaders

The HTTP message headers associated with a request or response.

Constructors

this
this(soup.types.MessageHeadersType type)

Creates a #SoupMessageHeaders.

Members

Functions

append
void append(string name, string value)

Appends a new header with name name and value value to hdrs.

cleanConnectionHeaders
void cleanConnectionHeaders()

Removes all the headers listed in the Connection header.

clear
void clear()

Clears hdrs.

foreach_
void foreach_(soup.types.MessageHeadersForeachFunc func)

Calls func once for each header value in hdrs.

freeRanges
void freeRanges(soup.types.Range ranges)

Frees the array of ranges returned from soup.message_headers.MessageHeaders.getRanges.

getContentDisposition
bool getContentDisposition(string disposition, string[string] params)

Looks up the "Content-Disposition" header in hdrs, parses it, and returns its value in *disposition and *params.

getContentLength
long getContentLength()

Gets the message body length that hdrs declare.

getContentRange
bool getContentRange(long start, long end, long totalLength)

Parses hdrs's Content-Range header and returns it in start, end, and total_length. If the total length field in the header was specified as "*", then total_length will be set to -1.

getContentType
string getContentType(string[string] params)

Looks up the "Content-Type" header in hdrs, parses it, and returns its value in *content_type and *params.

getEncoding
soup.types.Encoding getEncoding()

Gets the message body encoding that hdrs declare.

getExpectations
soup.types.Expectation getExpectations()

Gets the expectations declared by hdrs's "Expect" header.

getHeadersType
soup.types.MessageHeadersType getHeadersType()

Gets the type of headers.

getList
string getList(string name)

Gets the value of header name in hdrs.

getOne
string getOne(string name)

Gets the value of header name in hdrs.

getRanges
bool getRanges(long totalLength, soup.types.Range[] ranges)

Parses hdrs's Range header and returns an array of the requested byte ranges.

headerContains
bool headerContains(string name, string token)

Checks whether the list-valued header name is present in hdrs, and contains a case-insensitive match for token.

headerEquals
bool headerEquals(string name, string value)

Checks whether the header name is present in hdrs and is (case-insensitively) equal to value.

remove
void remove(string name)

Removes name from hdrs.

replace
void replace(string name, string value)

Replaces the value of the header name in hdrs with value.

setContentDisposition
void setContentDisposition(string disposition, string[string] params)

Sets the "Content-Disposition" header in hdrs to disposition, optionally with additional parameters specified in params.

setContentLength
void setContentLength(long contentLength)

Sets the message body length that hdrs will declare, and sets hdrs's encoding to soup.types.Encoding.ContentLength.

setContentRange
void setContentRange(long start, long end, long totalLength)

Sets hdrs's Content-Range header according to the given values.

setContentType
void setContentType(string contentType, string[string] params)

Sets the "Content-Type" header in hdrs to content_type.

setEncoding
void setEncoding(soup.types.Encoding encoding)

Sets the message body encoding that hdrs will declare.

setExpectations
void setExpectations(soup.types.Expectation expectations)

Sets hdrs's "Expect" header according to expectations.

setRange
void setRange(long start, long end)

Sets hdrs's Range header to request the indicated range.

setRanges
void setRanges(soup.types.Range ranges, int length)

Sets hdrs's Range header to request the indicated ranges.

Inherited Members

From Boxed

cInstancePtr
void* cInstancePtr;

Pointer to the C boxed value

getType
GType getType()

Get the GType of this boxed type.

gType
GType gType [@property getter]

Boxed GType property.

self
Boxed self()

Convenience method to return this cast to a type. For use in D with statements.

copy_
void* copy_()

Make a copy of the wrapped C boxed data.

boxedCopy
void* boxedCopy(void* cBoxed)

Copy a C boxed value using g_boxed_copy.

boxedFree
void boxedFree(void* cBoxed)

Free a C boxed value using g_boxed_free.