Response
Object Hierarchy:
Description:
[ Version ( since = "0.1" ) ]
public abstract class Response : Object
Response representing a request resource.
Content:
Properties:
- public virtual OutputStream body { get; }
Response body.
- public SList<Cookie> cookies { owned get; }
Response cookies extracted from the 'Set-Cookie' header.
- public bool head_written { get; }
Tells if the head has been written in the connection
GLib.OutputStream.
- public MessageHeaders headers { get; protected set construct; }
Response headers.
- public virtual string? reason_phrase { owned get; set; }
Response status message.
- public Request request { get; construct; }
Request to which this response is responding.
- public virtual uint status { get; set; }
Response status.
Creation methods:
Methods:
- public bool append (uint8[] buffer, Cancellable? cancellable = null) throws Error
Append a buffer into the response body, writting the head beforehand
and flushing data immediatly.
- public async bool append_async (uint8[] buffer, int priority = DEFAULT, Cancellable? cancellable = null) throws Error
- public bool append_bytes (Bytes buffer, Cancellable? cancellable = null) throws Error
- public async bool append_bytes_async (Bytes buffer, int priority = DEFAULT, Cancellable? cancellable = null) throws Error
- public bool append_utf8 (string buffer, Cancellable? cancellable = null) throws Error
- public async bool append_utf8_async (string buffer, int priority = DEFAULT, Cancellable? cancellable = null) throws Error
- public void convert (Converter converter, int64 content_length = -1)
Apply a converter to the response body.
- public override void dispose ()
Write the head before disposing references to other objects.
- public bool end (Cancellable? cancellable = null) throws IOError
End the response properly, writting the head if missing.
- public async bool end_async (int priority = DEFAULT, Cancellable? cancellable = null) throws Error
- public virtual bool expand (uint8[] buffer, Cancellable? cancellable = null) throws IOError
Expand a buffer into the response body.
- public virtual async bool expand_async (uint8[] buffer, int priority = DEFAULT, Cancellable? cancellable = null) throws Error
- public bool expand_bytes (Bytes bytes, Cancellable? cancellable = null) throws IOError
Expand a GLib.Bytes buffer into the
response body.
- public async bool expand_bytes_async (Bytes bytes, int priority = DEFAULT, Cancellable? cancellable = null) throws Error
- public virtual bool expand_file (File file, Cancellable? cancellable = null) throws Error
Expand the content of a file into the response body.
- public virtual async bool expand_file_async (File file, int priority = DEFAULT, Cancellable? cancellable = null) throws Error
- public virtual bool expand_stream (InputStream @in, Cancellable? cancellable = null) throws Error
- public virtual async bool expand_stream_async (InputStream @in, int priority = DEFAULT, Cancellable? cancellable = null) throws Error
- public bool expand_utf8 (string body, Cancellable? cancellable = null) throws IOError
Expand a UTF-8 string into the response body.
- public async bool expand_utf8_async (string body, int priority = DEFAULT, Cancellable? cancellable = null) throws Error
- public void tee (OutputStream tee_stream)
Split the body stream such that anything written to it are written
both in the base stream and the tee stream.
- public bool write_head (out size_t bytes_written, Cancellable? cancellable = null) throws IOError
Write status line and headers into the connection stream, emitting
'wrote-status-line' and 'wrote-headers' signals in the process.
- public async bool write_head_async (int priority = DEFAULT, Cancellable? cancellable = null, out size_t bytes_written) throws Error
- protected abstract bool write_headers (MessageHeaders headers, out size_t bytes_written, Cancellable? cancellable = null) throws IOError
Send headers to the client.
- protected virtual async bool write_headers_async (MessageHeaders headers, int priority = DEFAULT, Cancellable? cancellable = null, out size_t bytes_written) throws Error
- protected abstract bool write_status_line (HTTPVersion http_version, uint status, string reason_phrase, out size_t bytes_written, Cancellable? cancellable = null) throws IOError
Send the status line to the client.
- protected virtual async bool write_status_line_async (HTTPVersion http_version, uint status, string reason_phrase, int priority = DEFAULT, Cancellable? cancellable = null, out size_t bytes_written) throws Error
Signals:
Fields:
Inherited Members:
All known members inherited from class GLib.Object
- @get
- @new
- @ref
- @set
- add_toggle_ref
- add_weak_pointer
- bind_property
- connect
- constructed
- disconnect
- dispose
- dup_data
- dup_qdata
- force_floating
- freeze_notify
- get_class
- get_data
- get_property
- get_qdata
- get_type
- getv
- interface_find_property
- interface_install_property
- interface_list_properties
- is_floating
- new_valist
- new_with_properties
- newv
- notify
- notify_property
- ref_count
- ref_sink
- remove_toggle_ref
- remove_weak_pointer
- replace_data
- replace_qdata
- set_data
- set_data_full
- set_property
- set_qdata
- set_qdata_full
- set_valist
- setv
- steal_data
- steal_qdata
- thaw_notify
- unref
- watch_closure
- weak_ref
- weak_unref