refactor http method as an enum