soup.message_headers

Module for [MessageHeaders] class

Types 1

The HTTP message headers associated with a request or response.

Methods
void * _cPtr(Flag!"Dup" dup = No.Dup)
GType _gType() @property
MessageHeaders self()Returns `this`, for use in `with` statements.
void append(string name, string value)Appends a new header with name name and value value to hdrs.
void cleanConnectionHeaders()Removes all the headers listed in the Connection header.
void clear()Clears hdrs.
void foreach_(soup.types.MessageHeadersForeachFunc func)Calls func once for each header value in hdrs.
void freeRanges(soup.types.Range ranges)Frees the array of ranges returned from [soup.message_headers.MessageHeaders.getRanges].
bool getContentDisposition(out string disposition, out string[string] params)Looks up the "Content-Disposition" header in hdrs, parses it, and returns its value in disposition and params.
long getContentLength()Gets the message body length that hdrs declare.
bool getContentRange(out long start, out long end, out long totalLength)Parses hdrs's Content-Range header and returns it in start, end, and totallength. If the total length field in the header was specified as "*", then totallength will be set to -1.
string getContentType(out string[string] params)Looks up the "Content-Type" header in hdrs, parses it, and returns its value in content_type and params.
soup.types.Encoding getEncoding()Gets the message body encoding that hdrs declare.
soup.types.Expectation getExpectations()Gets the expectations declared by hdrs's "Expect" header.
soup.types.MessageHeadersType getHeadersType()Gets the type of headers. Returns: the header's type.
string getList(string name)Gets the value of header name in hdrs.
string getOne(string name)Gets the value of header name in hdrs.
bool getRanges(long totalLength, out soup.types.Range[] ranges)Parses hdrs's Range header and returns an array of the requested byte ranges.
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.
bool headerEquals(string name, string value)Checks whether the header name is present in hdrs and is (case-insensitively) equal to value.
void remove(string name)Removes name from hdrs.
void replace(string name, string value)Replaces the value of the header name in hdrs with value.
void setContentDisposition(string disposition, string[string] params = null)Sets the "Content-Disposition" header in hdrs to disposition, optionally with additional parameters specified in params.
void setContentLength(long contentLength)Sets the message body length that hdrs will declare, and sets hdrs's encoding to [soup.types.Encoding.ContentLength].
void setContentRange(long start, long end, long totalLength)Sets hdrs's Content-Range header according to the given values.
void setContentType(string contentType, string[string] params = null)Sets the "Content-Type" header in hdrs to content_type.
void setEncoding(soup.types.Encoding encoding)Sets the message body encoding that hdrs will declare.
void setExpectations(soup.types.Expectation expectations)Sets hdrs's "Expect" header according to expectations.
void setRange(long start, long end)Sets hdrs's Range header to request the indicated range.
void setRanges(soup.types.Range ranges, int length)Sets hdrs's Range header to request the indicated ranges.
Constructors
this(void * ptr, Flag!"Take" take)
this(soup.types.MessageHeadersType type)Creates a #SoupMessageHeaders.