*mizu.Ctx that provides access to everything sent by the client.
You can read data from the URL, query string, headers, forms, cookies, or JSON body using clear helper methods.
Path parameters
Use{name} in the route to mark a variable part of the path.
Read it with c.Param().
Query parameters
Query strings appear after a? in the URL, such as /search?q=go.
Read them with c.Query().
c.QueryValues().
Headers
Request headers contain metadata such as content type or authorization. You can read them from the request object.Forms
When a request sends form data, you can read it usingc.Form().
File uploads
To receive uploaded files, usec.MultipartForm() for multipart data.
Cookies
You can read and set cookies directly.JSON body
You can decode a JSON body into a struct withBindJSON().
It validates the data and rejects unknown fields.
Client IP
Get the IP address of the client that sent the request.Context
Use the request context to detect cancellation or timeouts.Summary
| Method | Purpose |
|---|---|
c.Param(name) | Path parameter |
c.Query(name) | Query string value |
c.QueryValues() | All query parameters |
c.Request().Header.Get(name) | Request header |
c.Form() | Form data |
c.MultipartForm(limit) | Multipart form with files |
c.Cookie(name) | Read cookie |
c.SetCookie(cookie) | Set cookie |
c.BindJSON(v, limit) | Parse JSON body |
c.ClientIP() | Client IP address |
c.Context() | Request context |