1

I am new to android and i am trying to update these values and it should be HttpPut method. I know only GET and POST method please anyone can guide me to convert this to PUT method. Now it is in POST method

JSONObject json = new JSONObject();

json.put("Id", "15");
json.put("LId", EnId);
json.put("Name",assetname);
json.put("Des",Description1);


HttpClient httpclient = new DefaultHttpClient();
HttpPost httpPost = new HttpPost(URL);
jsonObj = json.toString();

httpPost.setEntity(new StringEntity(jsonObj));
httpPost.setHeader("Accept", "application/json");
httpPost.setHeader("Content-type", "application/json");

HttpResponse httpResponse = httpclient.execute(httpPost);
int statusCode = httpResponse.getStatusLine().getStatusCode();
Rohit Vipin Mathews
  • 11,629
  • 15
  • 57
  • 112
Mister
  • 41
  • 7

0 Answers0