Package com.chatopera.bot.sdk.basics
Class RestAPI
java.lang.Object
com.chatopera.bot.sdk.basics.RestAPI
RestAPI接口
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.json.JSONObject
static org.json.JSONObject
static org.json.JSONObject
static org.json.JSONObject
static org.json.JSONObject
Getstatic org.json.JSONObject
static org.json.JSONObject
post
(String url, org.json.JSONObject body, HashMap<String, Object> query, HashMap<String, String> headers) Poststatic org.json.JSONObject
static org.json.JSONObject
put
(String url, org.json.JSONObject body, HashMap<String, Object> query, HashMap<String, String> headers) Put
-
Constructor Details
-
RestAPI
public RestAPI()
-
-
Method Details
-
post
public static org.json.JSONObject post(String url, org.json.JSONObject body, HashMap<String, Object> query, HashMap<String, throws kong.unirest.UnirestExceptionString> headers) Post- Parameters:
url
-body
-query
-headers
-- Returns:
- Throws:
kong.unirest.UnirestException
-
post
public static org.json.JSONObject post(String url, org.json.JSONObject body) throws kong.unirest.UnirestException - Throws:
kong.unirest.UnirestException
-
get
public static org.json.JSONObject get(String url, HashMap<String, Object> query, HashMap<String, throws kong.unirest.UnirestExceptionString> headers) Get- Parameters:
url
-query
-headers
-- Returns:
- Throws:
kong.unirest.UnirestException
-
get
- Throws:
kong.unirest.UnirestException
-
get
public static org.json.JSONObject get(String url, HashMap<String, Object> query) throws kong.unirest.UnirestException- Throws:
kong.unirest.UnirestException
-
delete
public static org.json.JSONObject delete(String url, HashMap<String, String> headers) throws kong.unirest.UnirestException- Throws:
kong.unirest.UnirestException
-
delete
public static org.json.JSONObject delete(String url, HashMap<String, String> headers, org.json.JSONObject body) throws kong.unirest.UnirestException- Throws:
kong.unirest.UnirestException
-
put
public static org.json.JSONObject put(String url, HashMap<String, Object> body, HashMap<String, throws kong.unirest.UnirestExceptionString> headers) - Throws:
kong.unirest.UnirestException
-
put
public static org.json.JSONObject put(String url, org.json.JSONObject body, HashMap<String, Object> query, HashMap<String, throws kong.unirest.UnirestExceptionString> headers) Put- Parameters:
url
-body
-query
-headers
-- Returns:
- Throws:
kong.unirest.UnirestException
-