logo

class

wisp::WispRes

sys::Obj
  web::WebRes
    wisp::WispRes

WispRes

Slots

checkUncommitted

Void checkUncommitted()

If the response has already been committed, then throw an Err.

Source

commit

Void commit()

If we haven't committed yet, then write the response header.

Source

cookies

override Cookie[] cookies := Cookie[,]

Get the list of cookies to set via a header fields. Add a a Cookie to this list to set a cookie. Once the response is commited, this list becomes readonly.

Source

done

override Void done()

Done is called to indicate that that response is complete to terminate pipeline processing. Once called, no further WebSteps in the pipeline are executed.

Source

headers

override Str:Str headers := Str:sys::Str][:]

Map of HTTP response headers. You must set all headers before you access out() for the first time, which commits the response. After the response is commited this map becomes read only.

Source

isCommitted

override readonly Bool isCommitted := false

Return true if this response has been commmited. A committed response has written its response headers, and can no longer modify its status code or headers. A response is committed the first time that out is called.

Source

isDone

override readonly Bool isDone := false

Return if this response is complete - see done.

Source

make

new make(WispService service, TcpSocket socket)

Source

out

override WebOutStream out

Return the WebOutStream for this response. The first time this method is accessed the response is committed: all headers currently set will be written to the stream, and can no longer be modified.

Source

redirect

override Void redirect(Uri uri, Int statusCode := 303)

Send a redirect response to the client using the specified status code and url. If this response has already been committed this method throws an Err.

Source

sendError

override Void sendError(Int statusCode, Str msg := null)

Send an error response to client using the specified status and HTML formatted message. If this response has already been committed this method throws an Err. If the server has a preconfigured page for this error code, it will trump the message passed in.

Source

service

override WispService service

WispService.

Source

statusCode

override Int statusCode := 200

Get or set the HTTP status code for this response. Status code defaults to 200. If response has already been committed, throws Err. If status code passed in is not recognized, throws Err.

Source