HttpPost post = new HttpPost(LOGIN_POST_URL); Gson gson = new Gson(); FormObj formObj = new FormObj(); formObj.setInput1(accountName); formObj.setInput2(userPass); formObj.setRemember("false"); String requestJson = gson.toJson(formObj); StringEntity stringEntity = new StringEntity(requestJson); post.setEntity(stringEntity); response = httpClient.execute(post, context);