@@ -6,109 +6,53 @@ package grequests // import "github.com/levigross/grequests"
6
6
// 2. A RequestOptions struct
7
7
// If you do not intend to use the `RequestOptions` you can just pass nil
8
8
func Get (url string , ro * RequestOptions ) (* Response , error ) {
9
- return doRequest ("GET" , url , ro )
10
- }
11
-
12
- // GetAsync takes 2 parameters and returns a Response channel. These two options are:
13
- // 1. A URL
14
- // 2. A RequestOptions struct
15
- // If you do not intend to use the `RequestOptions` you can just pass nil
16
- func GetAsync (url string , ro * RequestOptions ) chan * Response {
17
- return doAsyncRequest ("GET" , url , ro )
9
+ return doRegularRequest ("GET" , url , ro )
18
10
}
19
11
20
12
// Put takes 2 parameters and returns a Response struct. These two options are:
21
13
// 1. A URL
22
14
// 2. A RequestOptions struct
23
15
// If you do not intend to use the `RequestOptions` you can just pass nil
24
16
func Put (url string , ro * RequestOptions ) (* Response , error ) {
25
- return doRequest ("PUT" , url , ro )
26
- }
27
-
28
- // PutAsync takes 2 parameters and returns a Response channel. These two options are:
29
- // 1. A URL
30
- // 2. A RequestOptions struct
31
- // If you do not intend to use the `RequestOptions` you can just pass nil
32
- func PutAsync (url string , ro * RequestOptions ) chan * Response {
33
- return doAsyncRequest ("PUT" , url , ro )
17
+ return doRegularRequest ("PUT" , url , ro )
34
18
}
35
19
36
20
// Patch takes 2 parameters and returns a Response struct. These two options are:
37
21
// 1. A URL
38
22
// 2. A RequestOptions struct
39
23
// If you do not intend to use the `RequestOptions` you can just pass nil
40
24
func Patch (url string , ro * RequestOptions ) (* Response , error ) {
41
- return doRequest ("PATCH" , url , ro )
42
- }
43
-
44
- // PatchAsync takes 2 parameters and returns a Response channel. These two options are:
45
- // 1. A URL
46
- // 2. A RequestOptions struct
47
- // If you do not intend to use the `RequestOptions` you can just pass nil
48
- func PatchAsync (url string , ro * RequestOptions ) chan * Response {
49
- return doAsyncRequest ("PATCH" , url , ro )
25
+ return doRegularRequest ("PATCH" , url , ro )
50
26
}
51
27
52
28
// Delete takes 2 parameters and returns a Response struct. These two options are:
53
29
// 1. A URL
54
30
// 2. A RequestOptions struct
55
31
// If you do not intend to use the `RequestOptions` you can just pass nil
56
32
func Delete (url string , ro * RequestOptions ) (* Response , error ) {
57
- return doRequest ("DELETE" , url , ro )
58
- }
59
-
60
- // DeleteAsync takes 2 parameters and returns a Response channel. These two options are:
61
- // 1. A URL
62
- // 2. A RequestOptions struct
63
- // If you do not intend to use the `RequestOptions` you can just pass nil
64
- func DeleteAsync (url string , ro * RequestOptions ) chan * Response {
65
- return doAsyncRequest ("DELETE" , url , ro )
33
+ return doRegularRequest ("DELETE" , url , ro )
66
34
}
67
35
68
36
// Post takes 2 parameters and returns a Response channel. These two options are:
69
37
// 1. A URL
70
38
// 2. A RequestOptions struct
71
39
// If you do not intend to use the `RequestOptions` you can just pass nil
72
40
func Post (url string , ro * RequestOptions ) (* Response , error ) {
73
- return doRequest ("POST" , url , ro )
74
- }
75
-
76
- // PostAsync takes 2 parameters and returns a Response channel. These two options are:
77
- // 1. A URL
78
- // 2. A RequestOptions struct
79
- // If you do not intend to use the `RequestOptions` you can just pass nil
80
- func PostAsync (url string , ro * RequestOptions ) chan * Response {
81
- return doAsyncRequest ("POST" , url , ro )
41
+ return doRegularRequest ("POST" , url , ro )
82
42
}
83
43
84
44
// Head takes 2 parameters and returns a Response channel. These two options are:
85
45
// 1. A URL
86
46
// 2. A RequestOptions struct
87
47
// If you do not intend to use the `RequestOptions` you can just pass nil
88
48
func Head (url string , ro * RequestOptions ) (* Response , error ) {
89
- return doRequest ("HEAD" , url , ro )
90
- }
91
-
92
- // HeadAsync takes 2 parameters and returns a Response struct. These two options are:
93
- // 1. A URL
94
- // 2. A RequestOptions struct
95
- // If you do not intend to use the `RequestOptions` you can just pass nil
96
- func HeadAsync (url string , ro * RequestOptions ) chan * Response {
97
- return doAsyncRequest ("HEAD" , url , ro )
49
+ return doRegularRequest ("HEAD" , url , ro )
98
50
}
99
51
100
52
// Options takes 2 parameters and returns a Response struct. These two options are:
101
53
// 1. A URL
102
54
// 2. A RequestOptions struct
103
55
// If you do not intend to use the `RequestOptions` you can just pass nil
104
56
func Options (url string , ro * RequestOptions ) (* Response , error ) {
105
- return doRequest ("OPTIONS" , url , ro )
106
- }
107
-
108
- // OptionsAsync takes 2 parameters and returns a Response channel. These two options are:
109
- // 1. A URL
110
- // 2. A RequestOptions struct
111
- // If you do not intend to use the `RequestOptions` you can just pass nil
112
- func OptionsAsync (url string , ro * RequestOptions ) chan * Response {
113
- return doAsyncRequest ("OPTIONS" , url , ro )
57
+ return doRegularRequest ("OPTIONS" , url , ro )
114
58
}
0 commit comments