MessageHeaders
Object Hierarchy:
Description:
[ CCode ( copy_function = "g_boxed_copy" , free_function = "g_boxed_free" , type_id = "soup_message_headers_get_type ()" ) ]
[ Compact ]
public class MessageHeaders
The HTTP message headers associated with a request or response.
Content:
Creation methods:
Methods:
- public void @foreach (MessageHeadersForeachFunc func)
Calls func
once for each header value in
this.
- public unowned string? @get (string name)
Gets the value of header name
in
this.
- public void append (string name, string value)
Appends a new header with name name
and value value
to this.
- public void clean_connection_headers ()
Removes all the headers listed in the Connection header.
- public void clear ()
Clears this.
- public void free ()
Frees this.
- public void free_ranges (Range ranges)
Frees the array of ranges returned from
get_ranges.
- public bool get_content_disposition (out string disposition, out HashTable<string,string> @params)
Looks up the "Content-Disposition" header in
this, parses it, and returns its value in *disposition
and *params
.
- public int64 get_content_length ()
Gets the message body length that this
declare.
- public bool get_content_range (out int64 start, out int64 end, out int64 total_length)
Parses this's Content-Range header
and returns it in start
, end
, and total_length
.
- public unowned string? get_content_type (out HashTable<string,string> @params)
Looks up the "Content-Type" header in this
, parses it, and returns its value in *content_type
and *params
.
- public Encoding get_encoding ()
Gets the message body encoding that this
declare.
- public Expectation get_expectations ()
Gets the expectations declared by this
's "Expect" header.
- public MessageHeadersType get_headers_type ()
Gets the type of headers.
- public unowned string? get_list (string name)
Gets the value of header name
in
this.
- public unowned string? get_one (string name)
Gets the value of header name
in
this.
- public bool get_ranges (int64 total_length, out Range[] ranges)
Parses this's Range header and
returns an array of the requested byte ranges.
- public bool header_contains (string name, string token)
Checks whether the list-valued header name
is present in
this, and contains a case-insensitive match for token
.
- public bool header_equals (string name, string value)
Checks whether the header name
is present in
this and is (case-insensitively) equal to value
.
- public void remove (string name)
Removes name
from this.
- public void replace (string name, string value)
Replaces the value of the header name
in
this with value
.
- public void set_content_disposition (string disposition, HashTable<string,string>? @params)
Sets the "Content-Disposition" header in
this to disposition
, optionally with additional parameters specified in params
.
- public void set_content_length (int64 content_length)
Sets the message body length that this
will declare, and sets this's encoding to
CONTENT_LENGTH.
- public void set_content_range (int64 start, int64 end, int64 total_length)
Sets this's Content-Range header
according to the given values.
- public void set_content_type (string content_type, HashTable<string,string>? @params)
Sets the "Content-Type" header in this
to content_type
, optionally with additional parameters specified in params
.
- public void set_encoding (Encoding encoding)
Sets the message body encoding that this
will declare.
- public void set_expectations (Expectation expectations)
Sets this's "Expect" header
according to expectations
.
- public void set_range (int64 start, int64 end)
Sets this's Range header to request
the indicated range.
- public void set_ranges (Range ranges, int length)
Sets this's Range header to request
the indicated ranges.