https://github.com/go-macaron/method
Package method is a middleware that implements HTTP method override for Macaron.
https://github.com/go-macaron/method
Last synced: 23 days ago
JSON representation
Package method is a middleware that implements HTTP method override for Macaron.
- Host: GitHub
- URL: https://github.com/go-macaron/method
- Owner: go-macaron
- License: apache-2.0
- Created: 2014-12-05T03:55:59.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2020-04-01T07:25:05.000Z (almost 6 years ago)
- Last Synced: 2024-12-29T11:14:08.419Z (about 1 year ago)
- Language: Go
- Size: 6.84 KB
- Stars: 0
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
method
=======
Middlware method implements HTTP method override for [Macaron](https://github.com/go-macaron/macaron).
This checks for the X-HTTP-Method-Override header and uses it
if the original request method is POST.
GET/HEAD methods shouldn't be overriden, hence they can't be overriden.
This is useful for REST APIs and services making use of many HTTP verbs, and when http clients don't support all of them.
[API Reference](https://gowalker.org/github.com/go-macaron/method)
## Usage
```go
import (
"gopkg.in/macaron.v1"
"github.com/go-macaron/method"
)
func main() {
m := macaron.Classic()
m.Before(method.Override())
m.Run()
}
```
## Credits
This package is forked from [martini-contrib/method](https://github.com/martini-contrib/method) with modifications.
## License
This project is under Apache v2 License. See the [LICENSE](LICENSE) file for the full license text.