soup.message_headers
Module for [MessageHeaders] class
class MessageHeaders
Types 1
The HTTP message headers associated with a request or response.
Methods
void append(string name, string value) nothrowAppends a new header with name name and value value to hdrs.void foreach_(soup.types.MessageHeadersForeachFunc func) nothrowCalls func once for each header value in hdrs.void freeRanges(soup.types.Range ranges) nothrowFrees the array of ranges returned from [soup.message_headers.MessageHeaders.getRanges].bool getContentDisposition(out string disposition, out string[string] params) nothrowLooks up the "Content-Disposition" header in hdrs, parses it, and returns its value in *disposition and *params.bool getContentRange(out long start, out long end, out long totalLength) nothrowParses 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.string getContentType(out string[string] params) nothrowLooks up the "Content-Type" header in hdrs, parses it, and returns its value in *content_type and *params.soup.types.Expectation getExpectations() nothrowGets the expectations declared by hdrs's "Expect" header.soup.types.MessageHeadersType getHeadersType() nothrowGets the type of headers. Returns: the header's type.bool getRanges(long totalLength, out soup.types.Range[] ranges) nothrowParses hdrs's Range header and returns an array of the requested byte ranges.bool headerContains(string name, string token) nothrowChecks whether the list-valued header name is present in hdrs, and contains a case-insensitive match for token.bool headerEquals(string name, string value) nothrowChecks whether the header name is present in hdrs and is (case-insensitively) equal to value.void replace(string name, string value) nothrowReplaces the value of the header name in hdrs with value.void setContentDisposition(string disposition, string[string] params = null) nothrowSets the "Content-Disposition" header in hdrs to disposition, optionally with additional parameters specified in params.void setContentLength(long contentLength) nothrowSets 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) nothrowSets hdrs's Content-Range header according to the given values.void setContentType(string contentType, string[string] params = null) nothrowSets the "Content-Type" header in hdrs to content_type.void setEncoding(soup.types.Encoding encoding) nothrowSets the message body encoding that hdrs will declare.void setExpectations(soup.types.Expectation expectations) nothrowSets hdrs's "Expect" header according to expectations.void setRanges(soup.types.Range ranges, int length) nothrowSets hdrs's Range header to request the indicated ranges.Constructors
this(soup.types.MessageHeadersType type)Creates a #SoupMessageHeaders.