Documentation
¶
Index ¶
- Constants
- type BodyOp
- type BodyType
- type FileOp
- type ItemOp
- type Multipart
- func (r *Multipart) Bool(fieldName string, value bool) *Multipart
- func (r *Multipart) File(key, filename string, content io.Reader) *Multipart
- func (r *Multipart) FileCount() int
- func (r *Multipart) Float(fieldName string, value float64) *Multipart
- func (r *Multipart) Header(key, value string) *Multipart
- func (r *Multipart) Param(key, value string) *Multipart
- func (r *Multipart) ParamCount() int
- func (r *Multipart) Send() (*http.Response, error)
- func (r *Multipart) TotalOps() int
- type Request
- func (r *Request) Body(body io.ReadCloser, contentType string, contentLength int64) *Request
- func (r *Request) Bool(fieldName string, value bool) *Request
- func (r *Request) Bytes(body []byte, contentType string) *Request
- func (r *Request) Float(fieldName string, value float64) *Request
- func (r *Request) HasBody() bool
- func (r *Request) Header(key, value string) *Request
- func (r *Request) HeaderCount() int
- func (r *Request) JSON(body any) *Request
- func (r *Request) Param(key, value string) *Request
- func (r *Request) ParamCount() int
- func (r *Request) Send() (*http.Response, error)
Constants ¶
View Source
const ( ApplicationJSON = "application/json" ContentType = "Content-Type" ContentLength = "Content-Length" )
HTTP header constants used throughout the request package.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Multipart ¶
type Multipart struct {
// contains filtered or unexported fields
}
Multipart represents a multipart/form-data request builder.
func NewMultipart ¶
NewMultipart creates a new multipart/form-data request builder.
func NewMultipartWithOpsCapacity ¶ added in v1.4.1
func (*Multipart) ParamCount ¶ added in v1.4.3
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
Request represents an HTTP request builder with minimal allocations.
func NewRequest ¶
NewRequest creates a new HTTP request builder.
func NewRequestWithOpsCapacity ¶ added in v1.4.1
func (*Request) HeaderCount ¶ added in v1.4.3
func (*Request) ParamCount ¶ added in v1.4.3
Click to show internal directories.
Click to hide internal directories.