Last active
May 12, 2016 07:23
-
-
Save moneeb777/87fc86909c869d831ef7eb07d0bc6499 to your computer and use it in GitHub Desktop.
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
try { | |
// Create a new HttpClient | |
OkHttpClient client = new OkHttpClient(); | |
// Define request being sent to the server | |
RequestBody postData = new FormBody.Builder() | |
.add("lat", "Test") | |
.add("lng", "Test") | |
.build(); | |
Request request = new Request.Builder() | |
.url("http://codemobiles.com/adhoc/feed/youtube_feed.php") | |
.post(postData) | |
.build(); | |
// Transport the request and wait for response to process next | |
Response response = client.newCall(request).execute(); | |
String result = response.body().string(); | |
} catch (Exception e) { | |
e.printStackTrace(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment