A SERVICE OF

logo

42 Chapter 3
getStatusCode()
Returns the response status code.
Syntax
var code = resp.getStatusCode();
Parameters
This function has no parameters.
write()
Appends the specified text to the response object. When you use this method, you should
set the mime type to the type of text written (such as text/plain, text/xml, etc.).
Syntax
resp.write("This is the response");
resp.setMimeType("text/plain");
Parameters
The only parameter is the specified text string.
writeLine()
Appends the specified text to the response object and adds a new line. When you use this
method, you should set the mime type to the type of text written (such as text/plain,
text/xml, etc.).
Syntax
resp.writeLine("This is the response with a newline");
resp.setMimeType("text/plain");
Parameters
The only parameter is the specified text string.