I can tranfer HeaderParam's and QueryParam's. But how can I attach to HTTP client FormParam's?
private String addFormParams(Map<String, Object> formParams) {
JSONObject jsonObject = new JSONObject();
for (Map.Entry<String, Object> param : formParams.entrySet()) {
try {
jsonObject.put(param.getKey(), param.getValue());
} catch (JSONException e) {
Log.e(TAG, "JSONException " + e);
}
}
return jsonObject.toString();
}
StringEntity stringEntity = new StringEntity(addFormParams(formParams));
mHttpPost.setEntity(stringEntity);
It doesnt work.Is this right approach?