/
request.go
44 lines (39 loc) · 1.06 KB
/
request.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package requests
import (
"io"
"mime/multipart"
"net/http"
"net/url"
)
// HTTPRequest is for future uses.
type HTTPRequest interface {
AddCookie(*http.Cookie)
BasicAuth() (string, string, bool)
Cookie(string) (*http.Cookie, error)
Cookies() []*http.Cookie
FormFile(string) (multipart.File, *multipart.FileHeader, error)
FormValue(string) string
MultipartReader() (*multipart.Reader, error)
ParseForm() error
ParseMultipartForm(int64) error
PostFormValue(string) string
ProtoAtLeast(int, int) bool
Referer() string
SetBasicAuth(string, string)
UserAgent() string
Write(io.Writer) error
WriteProxy(io.Writer) error
}
// Request is a hybrid descendant of http.Request and http.Client.
// It is used as an argument to the functional options.
type Request struct {
// "Inherite" both http.Request and http.Client
*http.Request
*http.Client
*http.Transport
// Params is an alias used to add query parameters to
// the request through functional options.
// Values in Params have higher precedence over the
// query string in the initial URL.
Params url.Values
}