Documentation ¶
Overview ¶
Package request implements a set of utilities and structures for handling HTTP requests.
The request package provides functionality for working with HTTP requests, including parsing and manipulating request data, performing common operations such as sending requests, and handling response data.
Index ¶
Constants ¶
const ( GET Method = http.MethodGet // GET is the HTTP GET method. HEAD = http.MethodHead // HEAD is the HTTP HEAD method. POST = http.MethodPost // POST is the HTTP POST method. PUT = http.MethodPut // PUT is the HTTP PUT method. PATCH = http.MethodPatch // PATCH is the HTTP PATCH method. DELETE = http.MethodDelete // DELETE is the HTTP DELETE method. CONNECT = http.MethodConnect // CONNECT is the HTTP CONNECT method. OPTIONS = http.MethodOptions // OPTIONS is the HTTP OPTIONS method. TRACE = http.MethodTrace // TRACE is the HTTP TRACE method. ALL = "ALL" // ALL is representing as any HTTP method. UNDEFINED = "" // UNDEFINED is undefined HTTP method. )
Constants representing common HTTP methods.
These constants are of type Method and are assigned the values of the corresponding HTTP methods from the net/http package. Using these constants allows users of the request package to specify HTTP methods in a type-safe manner, rather than using raw strings.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Element ¶
type Element int
Element represents the different elements of a request that can be matched.
The Element type is used to specify which element of a request should be matched when analyzing the request for threats. It can be one of the following values:
- URI: specifies the request URI (path and query parameters) as the element to match
- Headers: specifies the request headers as the element to match
- Body: specifies the request body as the element to match
const ( // URI specifies the request URI (path and query parameters) as the request element to match. URI Element = iota // Headers specifies the request headers as the request element to match. Headers // Body specifies the request body as the request element to match. Body // Any specifies that any element of the request should be matched. Any )