- Sort Score
- Result 10 results
- Languages All
Results 31 - 40 of 42 for url (0.2 sec)
-
samples/simple-client/src/main/java/okhttp3/sample/OkHttpContributors.java
} public static void main(String... args) throws Exception { OkHttpClient client = new OkHttpClient(); // Create request for remote resource. Request request = new Request.Builder() .url(ENDPOINT) .build(); // Execute the request and retrieve the response. try (Response response = client.newCall(request).execute()) { // Deserialize HTTP response to concrete type.
Java - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Fri Apr 05 03:30:42 GMT 2024 - 2.2K bytes - Viewed (0) -
samples/slack/src/main/java/okhttp3/slack/RtmSession.java
if (webSocket != null) throw new IllegalStateException(); RtmStartResponse rtmStartResponse = slackApi.rtmStart(accessToken); webSocket = slackApi.rtm(rtmStartResponse.url, this); } // TODO(jwilson): can I read the response body? Do I have to? // the body from slack is a 0-byte-buffer @Override public synchronized void onOpen(WebSocket webSocket, Response response) {
Java - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Sat Nov 19 20:16:58 GMT 2016 - 2.4K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/RewriteResponseCacheControl.java
.build(); } public void run() throws Exception { for (int i = 0; i < 5; i++) { System.out.println(" Request: " + i); Request request = new Request.Builder() .url("https://api.github.com/search/repositories?q=http") .build(); OkHttpClient clientForCall; if (i == 2) { // Force this request's response to be written to the cache. This way, subsequent responses
Java - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Sat Jan 12 03:31:36 GMT 2019 - 2.6K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/Progress.java
import okio.ForwardingSource; import okio.Okio; import okio.Source; public final class Progress { public void run() throws Exception { Request request = new Request.Builder() .url("https://publicobject.com/helloworld.txt") .build(); final ProgressListener progressListener = new ProgressListener() { boolean firstUpdate = true;
Java - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Sat Jan 12 03:31:36 GMT 2019 - 3.9K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/PostStreamingWithPipe.java
private final OkHttpClient client = new OkHttpClient(); public void run() throws Exception { final PipeBody pipeBody = new PipeBody(); Request request = new Request.Builder() .url("https://api.github.com/markdown/raw") .post(pipeBody) .build(); streamPrimesToSinkAsynchronously(pipeBody.sink()); try (Response response = client.newCall(request).execute()) {
Java - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Fri Jul 06 03:18:15 GMT 2018 - 3.1K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/PostForm.java
Java - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Sun May 22 01:29:42 GMT 2016 - 1.4K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/CurrentDateHeader.java
.addInterceptor(new CurrentDateInterceptor()) .build(); public void run() throws Exception { Request request = new Request.Builder() .url("https://publicobject.com/helloworld.txt") .build(); try (Response response = client.newCall(request).execute()) { System.out.println(response.request().header("Date")); } }
Java - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Wed Oct 31 15:32:50 GMT 2018 - 1.8K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/AccessHeaders.java
import okhttp3.Response; public final class AccessHeaders { private final OkHttpClient client = new OkHttpClient(); public void run() throws Exception { Request request = new Request.Builder() .url("https://api.github.com/repos/square/okhttp/issues") .header("User-Agent", "OkHttp Headers.java") .addHeader("Accept", "application/json; q=0.5") .addHeader("Accept", "application/vnd.github.v3+json")
Java - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Sun May 22 01:29:42 GMT 2016 - 1.6K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/AsynchronousGet.java
import okhttp3.ResponseBody; public final class AsynchronousGet { private final OkHttpClient client = new OkHttpClient(); public void run() throws Exception { Request request = new Request.Builder() .url("http://publicobject.com/helloworld.txt") .build(); client.newCall(request).enqueue(new Callback() { @Override public void onFailure(Call call, IOException e) { e.printStackTrace(); }
Java - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Sun May 22 01:29:42 GMT 2016 - 1.9K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/Authenticate.java
.header("Authorization", credential) .build(); }) .build(); } public void run() throws Exception { Request request = new Request.Builder() .url("http://publicobject.com/secrets/hellosecret.txt") .build(); try (Response response = client.newCall(request).execute()) { if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
Java - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Thu Aug 12 07:26:27 GMT 2021 - 1.9K bytes - Viewed (0)