Put GET/POST task in a variable

Signed-off-by: Gawain Lynch <gawain.lynch@gmail.com>