3 ms·
Either you make a method of it and then you can call it in 1 line, or you can use some libraries like OkHttp from square which will let you do that with only 5
by flaie 11y ago
Either you make a method of it and then you can call it in 1 line, or you can use some libraries like OkHttp from square which will let you do that with only 5 indented lines, not 20+.
Request request = new Request.Builder()
.url("http://example.com/upload")
.post(RequestBody.create(IMAGE_JPEG, file)
.build();
Response response = new OkHttpClient().newCall(request).execute();
But yes Go's standard library is cool, but Java's ecosystem is too, and larger.