You can use the library okhttp3, very simple and I think will suit you
POST has PUT the queries etc, all written in a single small method, if desired.
MOSPRIME PUT request using OkHttp3
public String ServerQuery() throws IOException { OkHttpClient client = new OkHttpClient(); String json = getJson(); RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), json); Request request = new Request.Builder() .url(getUrl()) .put(body) .build(); Response response = client.newCall(request).execute(); return response.body().string(); } return null; }