public class KiteRequestHandler extends Object
Constructor and Description |
---|
KiteRequestHandler(Proxy proxy)
Initialize request handler.
|
Modifier and Type | Method and Description |
---|---|
okhttp3.Request |
createDeleteRequest(String url,
Map<String,Object> params,
String apiKey,
String accessToken)
Creates a DELETE request.
|
okhttp3.Request |
createGetRequest(String url,
Map<String,Object> params,
String apiKey,
String accessToken)
Creates a GET request.
|
okhttp3.Request |
createGetRequest(String url,
String apiKey,
String accessToken)
Creates a GET request.
|
okhttp3.Request |
createGetRequest(String url,
String commonKey,
String[] values,
String apiKey,
String accessToken)
Creates a GET request.
|
okhttp3.Request |
createJsonPostRequest(String url,
org.json.JSONArray jsonArray,
Map<String,Object> queryParams,
String apiKey,
String accessToken)
Create a POST request with body type JSON.
|
okhttp3.Request |
createPostRequest(String url,
Map<String,Object> params,
String apiKey,
String accessToken)
Creates a POST request.
|
okhttp3.Request |
createPutRequest(String url,
Map<String,Object> params,
String apiKey,
String accessToken)
Creates a PUT request.
|
org.json.JSONObject |
deleteRequest(String url,
Map<String,Object> params,
String apiKey,
String accessToken)
Makes a DELETE request.
|
String |
getCSVRequest(String url,
String apiKey,
String accessToken)
Makes GET request to fetch CSV dump.
|
org.json.JSONObject |
getRequest(String url,
Map<String,Object> params,
String apiKey,
String accessToken)
Makes a GET request.
|
org.json.JSONObject |
getRequest(String url,
String apiKey,
String accessToken)
Makes a GET request.
|
org.json.JSONObject |
getRequest(String url,
String commonKey,
String[] values,
String apiKey,
String accessToken)
Makes a GET request.
|
org.json.JSONObject |
postRequest(String url,
Map<String,Object> params,
String apiKey,
String accessToken)
Makes a POST request.
|
org.json.JSONObject |
postRequestJSON(String url,
org.json.JSONArray jsonArray,
Map<String,Object> queryParams,
String apiKey,
String accessToken)
Make a JSON POST request.
|
org.json.JSONObject |
putRequest(String url,
Map<String,Object> params,
String apiKey,
String accessToken)
Makes a PUT request.
|
public KiteRequestHandler(Proxy proxy)
proxy
- to be set for making requests.public org.json.JSONObject getRequest(String url, String apiKey, String accessToken) throws IOException, KiteException, org.json.JSONException
url
- is the endpoint to which request has to be sent.apiKey
- is the api key of the Kite Connect app.accessToken
- is the access token obtained after successful login process.IOException
- is thrown when there is a connection related error.KiteException
- is thrown for all Kite Trade related errors.org.json.JSONException
- is thrown for parsing errors.public org.json.JSONObject getRequest(String url, Map<String,Object> params, String apiKey, String accessToken) throws IOException, KiteException, org.json.JSONException
url
- is the endpoint to which request has to be sent.apiKey
- is the api key of the Kite Connect app.accessToken
- is the access token obtained after successful login process.params
- is the map of params which has to be sent as query params.IOException
- is thrown when there is a connection related error.KiteException
- is thrown for all Kite Trade related errors.org.json.JSONException
- is thrown for parsing errors.public org.json.JSONObject postRequest(String url, Map<String,Object> params, String apiKey, String accessToken) throws IOException, KiteException, org.json.JSONException
url
- is the endpoint to which request has to be sent.apiKey
- is the api key of the Kite Connect app.accessToken
- is the access token obtained after successful login process.params
- is the map of params which has to be sent in the body.IOException
- is thrown when there is a connection related error.KiteException
- is thrown for all Kite Trade related errors.org.json.JSONException
- is thrown for parsing errors.public org.json.JSONObject postRequestJSON(String url, org.json.JSONArray jsonArray, Map<String,Object> queryParams, String apiKey, String accessToken) throws IOException, KiteException, org.json.JSONException
url
- is the endpoint to which request has to be sent.apiKey
- is the api key of the Kite Connect app.accessToken
- is the access token obtained after successful login process.jsonArray
- is the JSON array of params which has to be sent in the body.IOException
- is thrown when there is a connection related error.KiteException
- is thrown for all Kite Trade related errors.org.json.JSONException
- is thrown for parsing errors.public org.json.JSONObject putRequest(String url, Map<String,Object> params, String apiKey, String accessToken) throws IOException, KiteException, org.json.JSONException
url
- is the endpoint to which request has to be sent.apiKey
- is the api key of the Kite Connect app.accessToken
- is the access token obtained after successful login process.params
- is the map of params which has to be sent in the body.IOException
- is thrown when there is a connection related error.KiteException
- is thrown for all Kite Trade related errors.org.json.JSONException
- is thrown for parsing errors.public org.json.JSONObject deleteRequest(String url, Map<String,Object> params, String apiKey, String accessToken) throws IOException, KiteException, org.json.JSONException
url
- is the endpoint to which request has to be sent.apiKey
- is the api key of the Kite Connect app.accessToken
- is the access token obtained after successful login process.params
- is the map of params which has to be sent in the query params.IOException
- is thrown when there is a connection related error.KiteException
- is thrown for all Kite Trade related errors.org.json.JSONException
- is thrown for parsing errors.public org.json.JSONObject getRequest(String url, String commonKey, String[] values, String apiKey, String accessToken) throws IOException, KiteException, org.json.JSONException
url
- is the endpoint to which request has to be sent.apiKey
- is the api key of the Kite Connect app.accessToken
- is the access token obtained after successful login process.commonKey
- is the key that has to be sent in query param for quote calls.values
- is the values that has to be sent in query param like 265, 256265, NSE:INFY.IOException
- is thrown when there is a connection related error.KiteException
- is thrown for all Kite Trade related errors.org.json.JSONException
- is thrown for parsing errors.public String getCSVRequest(String url, String apiKey, String accessToken) throws IOException, KiteException, org.json.JSONException
url
- is the endpoint to which request has to be done.apiKey
- is the api key of the Kite Connect app.accessToken
- is the access token obtained after successful login process.IOException
- is thrown when there is a connection related error.KiteException
- is thrown for all Kite Trade related errors.org.json.JSONException
public okhttp3.Request createGetRequest(String url, String apiKey, String accessToken)
url
- is the endpoint to which request has to be done.apiKey
- is the api key of the Kite Connect app.accessToken
- is the access token obtained after successful login process.public okhttp3.Request createGetRequest(String url, Map<String,Object> params, String apiKey, String accessToken)
url
- is the endpoint to which request has to be done.apiKey
- is the api key of the Kite Connect app.accessToken
- is the access token obtained after successful login process.params
- is the map of data that has to be sent in query params.public okhttp3.Request createGetRequest(String url, String commonKey, String[] values, String apiKey, String accessToken)
url
- is the endpoint to which request has to be done.apiKey
- is the api key of the Kite Connect app.accessToken
- is the access token obtained after successful login process.commonKey
- is the key that has to be sent in query param for quote calls.values
- is the values that has to be sent in query param like 265, 256265, NSE:INFY.public okhttp3.Request createPostRequest(String url, Map<String,Object> params, String apiKey, String accessToken)
url
- is the endpoint to which request has to be done.apiKey
- is the api key of the Kite Connect app.accessToken
- is the access token obtained after successful login process.params
- is the map of data that has to be sent in the body.public okhttp3.Request createJsonPostRequest(String url, org.json.JSONArray jsonArray, Map<String,Object> queryParams, String apiKey, String accessToken)
url
- is the endpoint to which request has to be done.apiKey
- is the api key of the Kite Connect app.accessToken
- is the access token obtained after successful login process.jsonArray
- is the JSONArray of data that has to be sent in the body.public okhttp3.Request createPutRequest(String url, Map<String,Object> params, String apiKey, String accessToken)
url
- is the endpoint to which request has to be done.apiKey
- is the api key of the Kite Connect app.accessToken
- is the access token obtained after successful login process.params
- is the map of data that has to be sent in the body.public okhttp3.Request createDeleteRequest(String url, Map<String,Object> params, String apiKey, String accessToken)
url
- is the endpoint to which request has to be done.apiKey
- is the api key of the Kite Connect app.accessToken
- is the access token obtained after successful login process.params
- is the map of data that has to be sent in the query params.Copyright © 2022. All rights reserved.