HTTP Redirect in Server Code


Is it possible to return a response with HTTP Redirect headers (Location + 3xx http status code) from a server code service?

Thanks in advance

I’ve just found the solution. I noticed we can access the response object in the Invocation context such as request, and set headers to it. The status code can be set as well: this.request.statusCode = 301. It might be helpful to mention that over here:

Glad you found a solution, @RAFAEL_PEREZ! We plan to completely rewrite the Cloud Code docs, btw.

1 Like