0

I tried following url with POST method.

URL : https://www.rampinteractive.com/api/app/sendmessage/313b4042-3bb3-4e2d-ad42-fd9103ebcdd9/32/-1/-1

Method : POST

parameter : message

But its form data request. Its working fine is PostMan Google Client. Check attached screen shot. But In Android it showing 500 Error. please help me.

enter image description here Android Code:

Map<String, String> data = new HashMap<String, String>();
                data.put("message", edit_usedid.getText().toString().trim());                callAPI("https://www.rampinteractive.com/api/app/sendmessage/313b4042-3bb3-4e2d-ad42-fd9103ebcdd9/32/40940/1", data, APItype.CUSTOMER_LOGIN);

Android Response:

    05-02 12:05:57.298 26211-26211/com.syzygy.extreme.sdealscustomer I/System.out: CUSTOMER_LOGIN URL is https://www.rampinteractive.com/api/app/sendmessage/313b4042-3bb3-4e2d-ad42-fd9103ebcdd9/32/40940/1
05-02 12:05:57.299 26211-26211/com.syzygy.extreme.sdealscustomer I/System.out: Content-Type : text/html; charset=utf-8
05-02 12:05:57.299 26211-26211/com.syzygy.extreme.sdealscustomer I/System.out: message : fsdfdsfsd
05-02 12:05:57.594 26211-26744/com.syzygy.extreme.sdealscustomer E/Volley: [316] BasicNetwork.performRequest: Unexpected response code 500 for https://www.rampinteractive.com/api/app/sendmessage/313b4042-3bb3-4e2d-ad42-fd9103ebcdd9/32/40940/1
05-02 12:05:57.595 26211-26211/com.syzygy.extreme.sdealscustomer I/System.out: onErrorResponse-CUSTOMER_LOGIN- null
PREMKUMAR
  • 8,283
  • 8
  • 28
  • 51

1 Answers1

0

I think problem is with your RequestProperty :

Content-Type : text/html; charset=utf-8

You should set that as application/json

@Override
public Map<String, String> getHeaders() throws AuthFailureError {
       Map<String, String> headers = new HashMap<>();
       headers.put("Content-Type", "application/json");
       return headers;
}
NehaK
  • 2,639
  • 1
  • 15
  • 31