Android: Http post with parameters not working

前端 未结 4 1528
栀梦
栀梦 2020-12-30 09:40

I need to create an HTTP POST request with parameters. I know there are many examples out there, I have tried using HTTPparams, NameValuePair etc but cant seem to get the co

4条回答
  •  臣服心动
    2020-12-30 10:08

    I'm not quite sure, from your description, but it would seem that your server expects a JSON content object instead of the data being encoded in the URL. Send something like this as the body of your post:

    {"username":"abcd","password":"1234"}
    

提交回复
热议问题