Documentation
¶
Index ¶
- type DataType
- type Request
- func (r *Request) Body(body io.ReadCloser, contentType string) *Request
- func (r *Request) Bool(key string, value bool) *Request
- func (r *Request) Float(key string, value float64) *Request
- func (r *Request) Header(key, value string) *Request
- func (r *Request) Int(key string, value int) *Request
- func (r *Request) JSON(body any) *Request
- func (r *Request) Param(key, value string) *Request
- func (r *Request) PathBool(key string, value bool) *Request
- func (r *Request) PathFloat(key string, value float64) *Request
- func (r *Request) PathInt(key string, value int) *Request
- func (r *Request) PathParam(key, value string) *Request
- func (r *Request) Send() (*http.Response, error)
- func (r *Request) Timeout(duration time.Duration) *Request
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
Request provides a builder for standard HTTP requests.
func NewRequest ¶
NewRequest creates a new HTTP request builder.
func (*Request) Body ¶
func (r *Request) Body(body io.ReadCloser, contentType string) *Request
Body sets the request body and Content-Type header.
func (*Request) PathBool ¶ added in v1.7.0
PathBool replaces a path variable placeholder with a boolean value.
func (*Request) PathFloat ¶ added in v1.7.0
PathFloat replaces a path variable placeholder with a float64 value.
func (*Request) PathInt ¶ added in v1.7.0
PathInt replaces a path variable placeholder with an integer value.
func (*Request) PathParam ¶ added in v1.7.0
PathParam replaces a path variable placeholder in the URL. Replaces {key} with the provided value. Example: "/users/{id}" with PathParam("id", "123") becomes "/users/123"
Click to show internal directories.
Click to hide internal directories.