Would you like the webtask.io experience in your own SaaS? Try

Redirect with access to body


I am trying to use a function to redirect on a form ‘POST’. If I use the callback model (function(context, cb)) I can easily read the body of the form from context.body but I can’t return a redirect, then I would need to post the form through ajax, which defeats the purpose of what I’m trying to do.

On the other hand, if I use the model for full HTTP control (function(context, req, res)) I can easily redirect, but I can’t seem to read the form body. The docs mention something about this: “the body of the request will be unconsumed unless the pb claim of the webtask token is set to 1” but it links to a deprecated feature that I can’t use with my account.

Does someone know of a way to either redirect with the callback programming model, or properly read the body with the req/res model?