Response
Object Hierarchy:
Description:
Response representing a request resource.
Namespace: VSGI
Package: vsgi-0.3
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:
- public Response ()
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:
- public signal void wrote_headers (MessageHeaders headers)
Emitted when the headers has been written.
- public signal void wrote_status_line (uint status, string reason_phrase)
Emitted when the status line has been written.
Fields:
- protected OutputStream? _body
Placeholder for the response body.
Inherited Members:
All known members inherited from class GLib.Object