Am 08.10.2014 19:46, schrieb Lemonfiend:

I need to receive a POST, and in return POST the same fields in the same
order with the same encoding as the original (paypal API).

HTTPServerRequest of course provides access to .contentType and .form,
but how do I best use these to craft the response? (is foreach-ing over
the .form guaranteed to be in the same order as the POSTed fields?)

What is the best way to accomplish this?

Yes, the form fields are always stored in the same order as they are
received (I'll mention this in the documentation). You should be able to
use formEncode(req.form) to get an encoded form equivalent to the
original request.