mirror of
https://github.com/square/okhttp.git
synced 2025-11-27 18:21:14 +03:00
Tidy up recipes.
Make names slightly more consistent.
This commit is contained in:
@@ -20,7 +20,7 @@ import com.squareup.okhttp.Request;
|
|||||||
import com.squareup.okhttp.Response;
|
import com.squareup.okhttp.Response;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
public final class Headers {
|
public final class AccessHeaders {
|
||||||
private final OkHttpClient client = new OkHttpClient();
|
private final OkHttpClient client = new OkHttpClient();
|
||||||
|
|
||||||
public void run() throws Exception {
|
public void run() throws Exception {
|
||||||
@@ -37,11 +37,9 @@ public final class Headers {
|
|||||||
System.out.println("Server: " + response.header("Server"));
|
System.out.println("Server: " + response.header("Server"));
|
||||||
System.out.println("Date: " + response.header("Date"));
|
System.out.println("Date: " + response.header("Date"));
|
||||||
System.out.println("Vary: " + response.headers("Vary"));
|
System.out.println("Vary: " + response.headers("Vary"));
|
||||||
|
|
||||||
response.body().close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String... args) throws Exception {
|
public static void main(String... args) throws Exception {
|
||||||
new Headers().run();
|
new AccessHeaders().run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -25,7 +25,7 @@ import com.squareup.okhttp.Response;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
public final class MultipartPost {
|
public final class PostMultipart {
|
||||||
/**
|
/**
|
||||||
* The imgur client ID for OkHttp recipes. If you're using imgur for anything
|
* The imgur client ID for OkHttp recipes. If you're using imgur for anything
|
||||||
* other than running these examples, please request your own client ID!
|
* other than running these examples, please request your own client ID!
|
||||||
@@ -61,6 +61,6 @@ public final class MultipartPost {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String... args) throws Exception {
|
public static void main(String... args) throws Exception {
|
||||||
new MultipartPost().run();
|
new PostMultipart().run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user