NuHTTP Class Reference

NuHTTPRequestHandler

Superclass: NSObject
Declared in: nu/server.nu

An HTTP request handler. Handlers consist of an action, a pattern, and a set of statements. The action is an HTTP verb such as "get" or "post", the pattern is either an NSString or a NuRegex, and the statements are Nu expressions to be evaluated in the request handling. Request handers are typically created using the "get" or "post" macros and are responsible for setting the response headers and returning the appropriate response data, which can be either raw data (in an NSData object) or a string containing HTML text.

Methods

+ (id) handlerWithAction: (id) action
pattern: (id) pattern
statements: (id) statements
Create a handler with a specified action, pattern, and statements. Used internally.

in nu/server.nu

- (id) matchAction: (id) action
path: (id) path
Try to match the handler against a specified action and path. Used internally.

in nu/server.nu

- (id) redirectResponse: (id) response
toLocation: (id) location
Return a response redirecting the client to a new location. This method may be called from action handlers.

in nu/server.nu