Documentation ¶
Index ¶
- Constants
- func CloneHeader(src http.Header) http.Header
- func CloneValues(src url.Values) url.Values
- type ContentType
- type FormFile
- type FormFiles
- type Option
- type Request
- func (r *Request) AddCookie(cookie *http.Cookie)
- func (r *Request) Do(ctx context.Context) (*http.Response, error)
- func (r *Request) FileForm() FormFiles
- func (r *Request) Form() url.Values
- func (r *Request) Header() http.Header
- func (r *Request) Query() url.Values
- func (r *Request) SetBody(body io.Reader)
- func (r *Request) SetContentType(contentType ContentType)
- func (r *Request) SetCookies(cookies []*http.Cookie)
- func (r *Request) SetFileForm(files FormFiles)
- func (r *Request) SetForm(form url.Values)
- func (r *Request) SetHeader(header http.Header)
- func (r *Request) SetQuery(query url.Values)
- func (r *Request) TrimURLQuery()
Constants ¶
View Source
const ( Post = http.MethodPost Get = http.MethodGet Head = http.MethodHead Put = http.MethodPut Delete = http.MethodDelete Patch = http.MethodPatch Options = http.MethodOptions )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ContentType ¶
type ContentType string
const ( ContentTypeJSON ContentType = "application/json" ContentTypeXML ContentType = "application/xml" ContentTypeURLEncode ContentType = "application/x-www-form-urlencoded" ContentTypeHTML ContentType = "text/html" ContentTypeText ContentType = "text/plain" ContentTypeMultipart ContentType = "multipart/form-data" )
type Request ¶
type Request struct { Method string // contains filtered or unexported fields }
func NewRequest ¶
func (*Request) SetContentType ¶
func (r *Request) SetContentType(contentType ContentType)
func (*Request) SetCookies ¶
func (*Request) SetFileForm ¶
func (*Request) TrimURLQuery ¶
func (r *Request) TrimURLQuery()
Click to show internal directories.
Click to hide internal directories.