Android Volley Post Request Header not changing

后端 未结 2 1398
温柔的废话
温柔的废话 2020-12-22 01:20

I am using Android Volley library to send POST request. And for POST request

  • Header is Content-Type:application/js
2条回答
  •  半阙折子戏
    2020-12-22 02:05

    Using network sniffing tool like Wireshark,I found that my error lay on wrong HTTP header. Then using Chrome DHC plugin

    I found that Header Content-Type should be application/json; charset=utf-8and I was continuously using

        Map header = new HashMap();
        header.put("Content-Type", "application/json");
    

    instead of

        Map header = new HashMap();
        header.put("Content-Type", "application/json; charset=utf-8");
    

    Using proper Header solved my issue

提交回复
热议问题