Fixed so that toCurl works for post and get