Skip to content

Instantly share code, notes, and snippets.

@moneeb777
Last active May 12, 2016 07:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moneeb777/87fc86909c869d831ef7eb07d0bc6499 to your computer and use it in GitHub Desktop.
Save moneeb777/87fc86909c869d831ef7eb07d0bc6499 to your computer and use it in GitHub Desktop.
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