Created
December 11, 2019 21:36
-
-
Save fernandohs1500/cfa804f57750e46bb9d639fcc5975944 to your computer and use it in GitHub Desktop.
HTTP CLIENT REQUEST JAVA
This file contains hidden or 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
jsonParams.put("wallet", billetRequest.getWallet()); | |
JSONObject jsonParams = new JSONObject(); | |
jsonParams.put("user", user); | |
StringEntity params = new StringEntity(jsonParams.toString()); | |
HttpPost post = new HttpPost(url); | |
post.addHeader("Authorization", autorizathion); | |
post.addHeader("Content-Type", "application/json"); | |
post.setEntity(params); | |
CloseableHttpClient httpClient = HttpClients.createDefault(); | |
CloseableHttpResponse response = httpClient.execute(post); | |
String result = EntityUtils.toString(response.getEntity()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment