-
Notifications
You must be signed in to change notification settings - Fork 30
/
SyncHttpClient.java
209 lines (179 loc) · 5.89 KB
/
SyncHttpClient.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
203
204
205
206
207
208
209
package com.puppetlabs.http.client;
import com.codahale.metrics.MetricRegistry;
import java.io.Closeable;
import java.net.URI;
import java.net.URISyntaxException;
/**
* This interface represents a synchronous HTTP client with which
* requests can be made. An object implementing this interface is
* returned by {@link com.puppetlabs.http.client.Sync#createClient(ClientOptions)}
*/
public interface SyncHttpClient extends Closeable {
/**
* @return the MetricRegistry instance associated with this Client
*/
public MetricRegistry getMetricRegistry();
/**
* @return the String metricNamespace for this Client
*/
public String getMetricNamespace();
/**
* Makes a configurable HTTP request
* @param requestOptions the options to configure the request
* @param method the type of the HTTP request
* @return the HTTP response
*/
public Response request(RequestOptions requestOptions, HttpMethod method);
/**
* Makes an HTTP GET request
* @param url the url against which to make the request
* @return the HTTP response
* @throws URISyntaxException
*/
public Response get(String url) throws URISyntaxException;
/**
* Makes an HTTP GET request
* @param uri the uri against which to make the request
* @return the HTTP response
*/
public Response get(URI uri);
/**
* Makes an HTTP GET request
* @param requestOptions the options to configure the request
* @return the HTTP response
*/
public Response get(RequestOptions requestOptions);
/**
* Makes an HTTP HEAD request
* @param url the url against which to make the request
* @return the HTTP response
* @throws URISyntaxException
*/
public Response head(String url) throws URISyntaxException;
/**
* Makes an HTTP HEAD request
* @param uri the uri against which to make the request
* @return the HTTP response
*/
public Response head(URI uri);
/**
* Makes an HTTP HEAD request
* @param requestOptions the options to configure the request
* @return the HTTP response
*/
public Response head(RequestOptions requestOptions);
/**
* Makes an HTTP POST request
* @param url the url against which to make the request
* @return the HTTP response
* @throws URISyntaxException
*/
public Response post(String url) throws URISyntaxException;
/**
* Makes an HTTP POST request
* @param uri the uri against which to make the request
* @return the HTTP response
*/
public Response post(URI uri);
/**
* Makes an HTTP POST request
* @param requestOptions the options to configure the request
* @return the HTTP response
*/
public Response post(RequestOptions requestOptions);
/**
* Makes an HTTP PUT request
* @param url the url against which to make the request
* @return the HTTP response
* @throws URISyntaxException
*/
public Response put(String url) throws URISyntaxException;
/**
* Makes an HTTP PUT request
* @param uri the uri against which to make the request
* @return the HTTP response
*/
public Response put(URI uri);
/**
* Makes an HTTP PUT request
* @param requestOptions the options to configure the request
* @return the HTTP response
*/
public Response put(RequestOptions requestOptions);
/**
* Makes an HTTP DELETE request
* @param url the url against which to make the request
* @return the HTTP response
* @throws URISyntaxException
*/
public Response delete(String url) throws URISyntaxException;
/**
* Makes an HTTP DELETE request
* @param uri the uri against which to make the request
* @return the HTTP response
*/
public Response delete(URI uri);
/**
* Makes an HTTP DELETE request
* @param requestOptions the options to configure the request
* @return the HTTP response
*/
public Response delete(RequestOptions requestOptions);
/**
* Makes an HTTP TRACE request
* @param url the url against which to make the request
* @return the HTTP response
* @throws URISyntaxException
*/
public Response trace(String url) throws URISyntaxException;
/**
* Makes an HTTP TRACE request
* @param uri the uri against which to make the request
* @return the HTTP response
*/
public Response trace(URI uri);
/**
* Makes an HTTP TRACE request
* @param requestOptions the options to configure the request
* @return the HTTP response
*/
public Response trace(RequestOptions requestOptions);
/**
* Makes an HTTP OPTIONS request
* @param url the url against which to make the request
* @return the HTTP response
* @throws URISyntaxException
*/
public Response options(String url) throws URISyntaxException;
/**
* Makes an HTTP OPTIONS request
* @param uri the uri against which to make the request
* @return the HTTP response
*/
public Response options(URI uri);
/**
* Makes an HTTP OPTIONS request
* @param requestOptions the options to configure the request
* @return the HTTP response
*/
public Response options(RequestOptions requestOptions);
/**
* Makes an HTTP PATCH request
* @param url the url against which to make the request
* @return the HTTP response
* @throws URISyntaxException
*/
public Response patch(String url) throws URISyntaxException;
/**
* Makes an HTTP PATCH request
* @param uri the uri against which to make the request
* @return the HTTP response
*/
public Response patch(URI uri);
/**
* Makes an HTTP PATCH request
* @param requestOptions the options to configure the request
* @return the HTTP response
*/
public Response patch(RequestOptions requestOptions);
}