sys::Obj sys::Virtual sys::OutStream web::WebRes
public class WebRes
WebRes models the response side of an HTTP transaction. All responses should be ordered as:
1. res.writeStatus 2. zero or more calls to res.writeHeader 3. res.finishHeaders 4. write body
public static const define int bufLen
public WebService service
Parent web service component
public override void close()
Print the buf contents using base64 encoding and return this.
Print the specified string escaping <, >, and & into the <, >, and &
public WebRes finishHeaders()
This call closes the header section and readys the output stream for the response content.
public override void flush()
public WebRes html()
Write out 200 OK status, text/html content type, and opening HTML markup.
public WebRes htmlEnd()
Write closing HTML markup.
public WebRes printDuration(long ticks)
Print duration in human readable form.
public WebRes printElapsed(long ticks)
Print elapsed duration from specified ticks to now.
public WebRes printProp(Component c, Slot prop)
Print the component's current value of the specified property.
public WebRes spaces(int num)
Print the specified number of spaces.
public WebRes td()
Write td start tag with no-wrap and left align.
Write th element with no-wrap and left align.
public WebRes trTitle(Str title, int colspan)
Write a tr element with the specified colspan that can be used as a title header to separate rows.
Print the specified string and return this.
public WebRes wi(int i)
Print the specified integer and return this.
public override bool write(int b)
public override bool writeBytes(byte[] b, int off, int len)
public WebRes writeContentType(Str val)
Convenience for writeHeader("Content-Type", val)
public WebRes writeHeader(Str name, Str val)
Write a header name/value pair. This call must be made between writeStatus() and finishHeaders().
public WebRes writeStatus(int status)
Write response status line with specified HTTP status code. This call must be the very first thing written.
public WebRes writeStatusOk()
Convenience for writeStatus(200)