handle http method