I want to send this type of data to my deployed machine learning model API in IBM Watson-Studio from an android application using Volley.
{
"fields":[
"Gender",
"Age",
"EstimatedSalary"
],
"values":[
Gender,
Age,
EstimatedSalary
]
}
I'm stuck at creating a JSON-Object for this requirement and send it to the API.
I'm stuck at creating the JSON-Object and couldn't proceed
protected Map<String, String> getParams() throws AuthFailureError {
Map<String, String> params = new HashMap<>();
params.put("fields","Gender");
params.put("values",Gender);
return super.getParams();
}
I know that doesn't work. But don't understand how to proceed.