Added the possibility of choosing how the request is processed.

Tried at my best to follow your code style. Might not be the best implementation though.