improved http method handling