Skip to content

Instantly share code, notes, and snippets.

@eufelipe
Last active June 17, 2017 18:18
Show Gist options
  • Save eufelipe/57e57e53389624c76027232bfa237ad7 to your computer and use it in GitHub Desktop.
Save eufelipe/57e57e53389624c76027232bfa237ad7 to your computer and use it in GitHub Desktop.
/*
import com.squareup.okhttp.Callback;
import com.squareup.okhttp.MultipartBuilder;
import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.Request;
import com.squareup.okhttp.RequestBody;
import com.squareup.okhttp.Response;
*/
OkHttpClient client = new OkHttpClient();
RequestBody requestBody = new MultipartBuilder()
.type(MultipartBuilder.FORM)
.addFormDataPart("key", "Value")
.build();
Request request = new Request.Builder()
.url("http://www.")
.post(requestBody)
.build();
client.newCall(request).enqueue(new Callback() {
@Override
public void onFailure(Request request, IOException e) {
}
@Override
public void onResponse(Response response) throws IOException {
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment