I am using current code for volley request. However, I am getting different response in postman and on response.
RequestQueue queue = Volley.newRequestQueue(this);
StringRequest strRequest = new StringRequest(Request.Method.POST, url,
new Response.Listener<String>()
{
@Override
public void onResponse(String response) {
Log.e("RESPONSE === ",response);
}
},
new Response.ErrorListener()
{
@Override
public void onErrorResponse(VolleyError error)
{
}
})
{
@Override
protected Map<String, String> getParams()
{
Map<String, String> params = new HashMap<String, String>();
params.put(getString(R.string.accessKeyForApi), SingleTonModel.accesskey);
return params;
}
};
queue.add(strRequest);
What i am getting from Postman is:
[
{
"sectionHeader": "Today",
"data": []
},
{
"sectionHeader": "1 day ago",
"data": [
{
"id": "3",
"symbol_name": "EURUSD",
"order_open_price": "1.20366",
"signal_trading": "STRONG (--)",
"date_time": "2018-01-11 21:37:48",
"ticket": "79053141"
},
{
"id": "2",
"symbol_name": "EURUSD",
"order_open_price": "1.20331",
"signal_trading": "STRONG",
"date_time": "2018-01-11 20:15:03",
"ticket": "79053141"
}
]
},
{
"sectionHeader": "2 day ago",
"data": []
}
]
What I am getting in Log in Android studio
E/RESPONSE ===: {"0":{"sectionHeader":"Today","data":[]},"1":{"sectionHeader":"1 day ago","data":[]},"2":{"sectionHeader":"2 day ago","data":[]}}
I have added all permissions and also referred the link and here. I am unable to find the cause, can anyone tell me what I missed.