Original post

When working with any form of http communication in you’re going to come across scenarios where you need to know a request’s method – whether it’s a GET, POST, etc.
If you’re writing an API with Go you’ll most likely have the incoming request in the form of a http.Request object. This request has Method property which allows you to get the http method in the form of a string.