/
request.go
55 lines (44 loc) · 1.42 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
45
46
47
48
49
50
51
52
53
54
55
package gclient
import (
"github.com/jianzhiyao/gclient/request"
)
//NewRequest new request
func NewRequest(method, url string) (*request.Request, error) {
return request.New(method, url)
}
//NewRequestGet new request of http.MethodGet
func NewRequestGet(url string) (*request.Request, error) {
return request.Get(url)
}
//NewRequestHead new request of http.MethodHead
func NewRequestHead(url string) (*request.Request, error) {
return request.Head(url)
}
//NewRequestPost new request of http.MethodPost
func NewRequestPost(url string) (*request.Request, error) {
return request.Post(url)
}
//NewRequestPut new request of http.MethodPut
func NewRequestPut(url string) (*request.Request, error) {
return request.Put(url)
}
//NewRequestPatch new request of http.MethodPatch
func NewRequestPatch(url string) (*request.Request, error) {
return request.Patch(url)
}
//NewRequestDelete new request of http.MethodDelete
func NewRequestDelete(url string) (*request.Request, error) {
return request.Delete(url)
}
//NewRequestConnect new request of http.MethodConnect
func NewRequestConnect(url string) (*request.Request, error) {
return request.Connect(url)
}
//NewRequestOptions new request of http.MethodOptions
func NewRequestOptions(url string) (*request.Request, error) {
return request.Options(url)
}
//NewRequestTrace new request of http.MethodTrace
func NewRequestTrace(url string) (*request.Request, error) {
return request.Trace(url)
}