HttpResponse
generated from ../src/mod_wxjs/httpresp.cppThe HTTP response. There is only one instance of this class and it's automatically instantiated: 'response'.
Constants
Properties
| Name | Type | Description |
|---|---|---|
| contentType | String | The content type |
| encoding | String | The character encoding. The default encoding is UTF-16. |
headers ![]() |
ApacheTable | A table with all output headers. Make sure that you set all headers and cookies before you write any output! |
| status | Integer | The HTTP status |
| statusLine | String | The status line |
Methods
createCookie
createCookie(Name,
Value) : Cookie
| Name | Type | Default | Description |
|---|---|---|---|
| Name | String | The name of the cookie | |
| Value | String | The value of the cookie |
Creates a new Cookie object. Note that this method doesn't put the cookie into the output headers. The example shows how to use the 'Set-Cookie' header:
var newCookie = response.createCookie('loggedin', 'yes');
response.headers['Set-Cookie'] = newCookie.toString();
print()
Use this function to print information to the output. This output is send to the client. You can pass as many arguments as you wish. An example:
var i = 1;
response.print("<b>Test: ", i, "</b>");
Make sure that you set all headers and cookies before you write any output!
write
write(Buffer)
| Name | Type | Default | Description |
|---|---|---|---|
| Buffer | wxMemoryBuffer | A buffer to write to the client |
Use this function to write a buffer to a client (you can use this to write an image for example).
Make sure that you set all headers and cookies before you write any output!

© 2002 - 2007 Franky Braem.