Files
b1f77cf536 feat(gin): add support for the HTTP QUERY method (RFC 10008) (#4806)
* feat: add support for the HTTP QUERY method (RFC 10008)

Add a QUERY shortcut on RouterGroup, a gin.MethodQuery constant and a
gin.IQueryRoutes interface for callers that only hold an IRoutes value.

QUERY is deliberately kept out of IRoutes and out of Any:

- Adding a method to IRoutes would break every type outside of Gin that
  implements it, such as test doubles and wrappers.
- Leaving Any untouched keeps existing catch-all routes matching exactly
  the methods they matched before. Match([]string{gin.MethodQuery, ...})
  covers the case where QUERY is wanted alongside other methods.

MethodQuery is declared in Gin because the standard library does not
provide http.MethodQuery yet. The value stays correct once it does.

Ref #4721

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix(router): remove duplicate QUERY method

- Consolidate QUERY into the existing router method after merging master
- Preserve the MethodQuery constant and request body documentation

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2026-09-19 14:20:37 +08:00
..
2017-06-12 22:35:10 -05:00

Gin Default Server

This is API experiment for Gin.

package main

import (
	"github.com/gin-gonic/gin"
	"github.com/gin-gonic/gin/ginS"
)

func main() {
	ginS.GET("/", func(c *gin.Context) { c.String(200, "Hello World") })
	ginS.Run()
}