Created
August 19, 2016 18:22
-
-
Save mplacona/bc603a71883e47bdab052afed256d216 to your computer and use it in GitHub Desktop.
MainActivity.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
Call post(String url, Callback callback) throws IOException{ | |
RequestBody formBody = new FormBody.Builder() | |
.add("To", mTo.getText().toString()) | |
.add("Body", mBody.getText().toString()) | |
.build(); | |
Request request = new Request.Builder() | |
.url(url) | |
.post(formBody) | |
.build(); | |
Call response = mClient.newCall(request); | |
response.enqueue(callback); | |
return response; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment