-
public class ApiRequest.BuilderBuilder class for ApiRequest.
-
-
Method Summary
Modifier and Type Method Description ApiRequest.Builderheaders(HashMap<String, String> headers)Sets the request headers. ApiRequest.BuilderformDatas(HashMap<String, String> formDatas)Sets the form data parameters. ApiRequest.BuilderformDataType(FormDataType formDataType)Sets how form data should be sent. ApiRequest.BuildernonceFetchParams(HashMap<String, String> nonceFetchParams)Sets the parameters used for nonce fetching. ApiRequest.BuilderjsonBody(String jsonBody)Sets the JSON body for the request. ApiRequest.BuilderjsonBody(Object jsonBodyObject)Sets the JSON body from an Object (will be converted using Gson). ApiRequest.BuilderjsonBody(JSONObject jsonObject)Sets the JSON body from a JSONObject. ApiRequest.BuildershouldConvertToJson(boolean shouldConvertToJson)Sets whether the response should be converted to JSON.Default is true. ApiRequest.Builderlistener(ApiResponseListener listener)Sets the response listener. ApiRequestbuild()Builds the ApiRequest instance. -
-
Method Detail
-
headers
ApiRequest.Builder headers(HashMap<String, String> headers)
Sets the request headers.
- Parameters:
headers- Map of header key-value pairs
-
formDatas
ApiRequest.Builder formDatas(HashMap<String, String> formDatas)
Sets the form data parameters.
- Parameters:
formDatas- Map of form data key-value pairs
-
formDataType
ApiRequest.Builder formDataType(FormDataType formDataType)
Sets how form data should be sent.
- Parameters:
formDataType- The form data type (BODY_FORM_DATA or URL_PARAM)
-
nonceFetchParams
ApiRequest.Builder nonceFetchParams(HashMap<String, String> nonceFetchParams)
Sets the parameters used for nonce fetching.
- Parameters:
nonceFetchParams- Map of nonce fetch parameters
-
jsonBody
ApiRequest.Builder jsonBody(String jsonBody)
Sets the JSON body for the request.
Note: If jsonBody is set, formDatas will be ignored.
- Parameters:
jsonBody- The JSON string body
-
jsonBody
ApiRequest.Builder jsonBody(Object jsonBodyObject)
Sets the JSON body from an Object (will be converted using Gson).
Note: If jsonBody is set, formDatas will be ignored.
- Parameters:
jsonBodyObject- The object to convert to JSON
-
jsonBody
ApiRequest.Builder jsonBody(JSONObject jsonObject)
Sets the JSON body from a JSONObject.
Note: If jsonBody is set, formDatas will be ignored.
- Parameters:
jsonObject- The JSONObject to use as body
-
shouldConvertToJson
ApiRequest.Builder shouldConvertToJson(boolean shouldConvertToJson)
Sets whether the response should be converted to JSON.Default is true.
- Parameters:
shouldConvertToJson- true to convert response to JSON
-
listener
ApiRequest.Builder listener(ApiResponseListener listener)
Sets the response listener.
- Parameters:
listener- The ApiResponseListener to receive callbacks
-
build
ApiRequest build()
Builds the ApiRequest instance.
-
-
-
-