Copy the contents of the URL to a new browser page.
Your handler will have access to the request object, and can specify response headers, as in this example:
uri: "" + request.getRequestURI(), // Partial path without host/port
url: "" + request.getRequestURL(), // Full URL
method: "" + request.getMethod(), // GET, POST, etc
pathInfo: "" + request.getPathInfo(), // /<account>/<project>/<path>
acceptHeader: "" + request.getHeader("Accept"), // Any HTTP header
fooParam: "" + request.getParameter("foo") // Gets value of e.g. ...?foo=123
Please note that the
object is a Java request object (more specifically an instance of HttpServletRequest
), which is different than the request objects you get in other contexts (rules, events, etc...). This is because, when writing a handler, you are completely taking control -- Live API Creator will therefore not create a standard request object.
responseHeaders variable is a Java Map. You can call
put on it. If you do not specify any response headers,
application/json is returned by default.