Context
Context (Ctx) holds the HTTP request, response and provide methods
#
ContextAllows you to use all Fasthttp methods and properties (check Fasthttp Documentation for more information)
Example
#
ParamReturns value of path parameter specified by key in request
Example
#
SendBytesSets the body of response for bytes type
Example
#
SendStringSets the body of response for string type
Example
#
SendJSONSets the body of response for any interface after converting any interface to json and sets content type header to application/json
Example
#
StatusSets the HTTP status code of response
Example
#
GetReturns the HTTP request header specified by field key
Example
#
SetSets the response's HTTP header field key to the specified key, value
Example
#
QueryReturns the query string parameter in the request url
Example
#
BodyReturns the raw body (string) submitted in a POST request
Example
#
ParseBodyParses request body into provided struct. Currently, Supports decoding theses types: application/json.
Example