diff --git a/docs/doc.md b/docs/doc.md index 302e8099..c21f756c 100644 --- a/docs/doc.md +++ b/docs/doc.md @@ -7,6 +7,7 @@ - [Build without MsgPack rendering feature](#build-without-msgpack-rendering-feature) - [Routing](#routing) - [Using GET, POST, PUT, PATCH, QUERY, DELETE and OPTIONS](#using-get-post-put-patch-delete-query-and-options) + - [QUERY Method (RFC 10008)](#query-method-rfc-10008) - [Parameters in path](#parameters-in-path) - [Querystring parameters](#querystring-parameters) - [Multipart/Urlencoded Form](#multiparturlencoded-form) @@ -127,7 +128,7 @@ func main() { router.PUT("/somePut", putting) router.DELETE("/someDelete", deleting) router.PATCH("/somePatch", patching) - router.QUERY("/somePatch", querying) + router.QUERY("/someQuery", querying) router.HEAD("/someHead", head) router.OPTIONS("/someOptions", options) @@ -137,6 +138,19 @@ func main() { // router.Run(":3000") for a hard coded port } ``` +### QUERY Method (RFC 10008) + +Gin supports the HTTP `QUERY` method defined by RFC 10008. + +```go +router.QUERY("/search", querying) +``` + +The exported `gin.MethodQuery` constant can be used wherever an HTTP method is required, such as when constructing requests: + +```go +req := httptest.NewRequest(gin.MethodQuery, "/query", nil) +``` ### Parameters in path