Sign In Register

How can we help you today?

Start a new topic
Answered

SendRequestAs question

So the docs for sendRequestAs state "The response as would be returned to the client"

My plan was to use SendRequestAs as sort of an admin function (possibly called through callback) - and I don't see how the response could be sent to the client - as there really IS no client in the case of cloud code executed through a server callback (for example).


Thoughts?


Best Answer

Hi Jeff,


When using SendRequestAs, the response is returned to cloud code as the return value of the method call. You could assign this to a variable and treat it as any other JavaScript object in code.

The documentation states "The response as would be returned to the client", not "The response returned to the client".


Regards,


Jonathan.


Answer

Hi Jeff,


When using SendRequestAs, the response is returned to cloud code as the return value of the method call. You could assign this to a variable and treat it as any other JavaScript object in code.

The documentation states "The response as would be returned to the client", not "The response returned to the client".


Regards,


Jonathan.

okdokey...thanks!!

Login to post a comment