-
Notifications
You must be signed in to change notification settings - Fork 30
/
AsyncHttpClient.java
202 lines (173 loc) · 6.52 KB
/
AsyncHttpClient.java
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
package com.puppetlabs.http.client;
import com.codahale.metrics.MetricRegistry;
import com.puppetlabs.http.client.impl.Promise;
import java.io.Closeable;
import java.net.URI;
import java.net.URISyntaxException;
/**
* This interface represents an asynchronous HTTP client with which
* requests can be made. An object implementing this interface is returned by
* {@link com.puppetlabs.http.client.Async#createClient(ClientOptions)}.
*/
public interface AsyncHttpClient extends Closeable{
/**
* @return the MetricRegistry instance associated with this Client
*/
public MetricRegistry getMetricRegistry();
/**
* @return the String metricNamespace for this Client
*/
public String getMetricNamespace();
/**
* Performs a GET request
* @param url the URL against which to make the GET request
* @return a Promise with the contents of the response
* @throws URISyntaxException
*/
public Promise<Response> get(String url) throws URISyntaxException;
/**
* Performs a GET request
* @param uri the URI against which to make the GET request
* @return a Promise with the contents of the response
*/
public Promise<Response> get(URI uri);
/**
* Performs a GET request
* @param requestOptions options to configure the GET request
* @return a Promise with the contents of the response
*/
public Promise<Response> get(RequestOptions requestOptions);
/**
* Performs a HEAD request
* @param url the URL against which to make the HEAD request
* @return a Promise with the contents of the response
* @throws URISyntaxException
*/
public Promise<Response> head(String url) throws URISyntaxException;
/**
* Performs a HEAD request
* @param uri the URI against which to make the HEAD request
* @return a Promise with the contents of the response
*/
public Promise<Response> head(URI uri);
/**
* Performs a HEAD request
* @param requestOptions options to configure the HEAD request
* @return a Promise with the contents of the response
*/
public Promise<Response> head(RequestOptions requestOptions);
/**
* Performs a POST request
* @param url the URL against which to make the POST request
* @return a Promise with the contents of the response
* @throws URISyntaxException
*/
public Promise<Response> post(String url) throws URISyntaxException;
/**
* Performs a POST request
* @param uri the URI against which to make the POST request
* @return a Promise with the contents of the response
*/
public Promise<Response> post(URI uri);
/**
* Performs a POST request
* @param requestOptions options to configure the POST request
* @return a Promise with the contents of the response
*/
public Promise<Response> post(RequestOptions requestOptions);
/**
* Performs a PUT request
* @param url the URL against which to make the PUT request
* @return a Promise with the contents of the response
* @throws URISyntaxException
*/
public Promise<Response> put(String url) throws URISyntaxException;
/**
* Performs a PUT request
* @param uri the URI against which to make the PUT request
* @return a Promise with the contents of the response
*/
public Promise<Response> put(URI uri);
/**
* Performs a PUT request
* @param requestOptions options to configure the PUT request
* @return a Promise with the contents of the response
*/
public Promise<Response> put(RequestOptions requestOptions);
/**
* Performs a DELETE request
* @param url the URL against which to make the DELETE request
* @return a Promise with the contents of the response
* @throws URISyntaxException
*/
public Promise<Response> delete(String url) throws URISyntaxException;
/**
* Performs a DELETE request
* @param uri the URI against which to make the DELETE request
* @return a Promise with the contents of the response
*/
public Promise<Response> delete(URI uri);
/**
* Performs a DELETE request
* @param requestOptions options to configure the DELETE request
* @return a Promise with the contents of the response
*/
public Promise<Response> delete(RequestOptions requestOptions);
/**
* Performs a TRACE request
* @param url the URL against which to make the TRACE request
* @return a Promise with the contents of the response
* @throws URISyntaxException
*/
public Promise<Response> trace(String url) throws URISyntaxException;
/**
* Performs a TRACE request
* @param uri the URI against which to make the TRACE request
* @return a Promise with the contents of the response
*/
public Promise<Response> trace(URI uri);
/**
* Performs a TRACE request
* @param requestOptions options to configure the TRACE request
* @return a Promise with the contents of the response
*/
public Promise<Response> trace(RequestOptions requestOptions);
/**
* Performs an OPTIONS request
* @param url the URL against which to make the OPTIONS request
* @return a Promise with the contents of the response
* @throws URISyntaxException
*/
public Promise<Response> options(String url) throws URISyntaxException;
/**
* Performs an OPTIONS request
* @param uri the URI against which to make the OPTIONS request
* @return a Promise with the contents of the response
*/
public Promise<Response> options(URI uri);
/**
* Performs an OPTIONS request
* @param requestOptions options to configure the OPTIONS request
* @return a Promise with the contents of the response
*/
public Promise<Response> options(RequestOptions requestOptions);
/**
* Performs a PATCH request
* @param url the URL against which to make the PATCH request
* @return a Promise with the contents of the response
* @throws URISyntaxException
*/
public Promise<Response> patch(String url) throws URISyntaxException;
/**
* Performs a PATCH request
* @param uri the URI against which to make the PATCH request
* @return a Promise with the contents of the response
*/
public Promise<Response> patch(URI uri);
/**
* Performs a PATCH request
* @param requestOptions options to configure the PATCH request
* @return a Promise with the contents of the response
*/
public Promise<Response> patch(RequestOptions requestOptions);
}