Created
April 10, 2015 02:05
-
-
Save javawolfpack/9874d5e9a79b614f47b7 to your computer and use it in GitHub Desktop.
HTTP Post Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HttpPost httpost = new HttpPost("<Server address here>"); | |
StringEntity se = new StringEntity(JSONObject.toString()); | |
httpost.setEntity(se); | |
httpost.setHeader("Accept", "application/json"); | |
httpost.setHeader("Content-type", "application/json"); | |
ResponseHandler responseHandler = new BasicResponseHandler(); | |
String responseBody = httpclient.execute(httpost, responseHandler); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment