-
Notifications
You must be signed in to change notification settings - Fork 76
Expand file tree
/
Copy pathHttpClient.java
More file actions
54 lines (47 loc) · 1.41 KB
/
HttpClient.java
File metadata and controls
54 lines (47 loc) · 1.41 KB
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
package com.icoderman.woocommerce;
import java.util.Map;
/**
* Basic interface for HTTP client
*/
public interface HttpClient {
/**
* Requests url with HTTP GET and returns result object as Map
*
* @param url url to request
* @return retrieved result
*/
Map get(String url);
/**
* Requests url with HTTP GET and returns List of objects (Maps)
*
* @param url url to request
* @return retrieved result
*/
Page getAll(String url);
/**
* Requests url with HTTP POST and retrieves result object as Map
*
* @param url url to request
* @param params request params
* @param object request object with will be sent as json
* @return retrieved result
*/
Map post(String url, Map<String, String> params, Map<String, Object> object);
/**
* Requests url with HTTP PUT and retrieves result object as Map
*
* @param url url to request
* @param params request params
* @param object request object with will be sent as json
* @return retrieved result
*/
Map put(String url, Map<String, String> params, Map<String, Object> object);
/**
* Requests url with HTTP DELETE and retrieves result object as Map
*
* @param url url to request
* @param params request params
* @return retrieved result
*/
Map delete(String url, Map<String, String> params);
}