Adding body of call to POST using HttpURLConnection
问题 I am trying to use HTTPURLConnection make a POST method call to a server api. The JSON version of the body of my call is: { "grant_type" : "password", "username" : "perry.marange@zmod.co", "password" : "password" } How do I add this part using httpURLConnection? 回答1: i think you can use the Android Rest-Client for sending data to a webservice take classes RequestMethod.java and RestClient.java from this link https://github.com/TylerSmithNet/RESTclient-Android/tree/master/RESTclient-example