- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 45 for new (0.35 sec)
-
samples/static-server/src/main/java/okhttp3/sample/SampleServer.java
MockWebServer server = new MockWebServer(); server.useHttps(sslContext.getSocketFactory(), false); server.setDispatcher(this); server.start(port); } @Override public MockResponse dispatch(RecordedRequest request) { String path = request.getPath(); try { if (!path.startsWith("/") || path.contains("..")) throw new FileNotFoundException();
Java - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Wed Jan 02 02:50:44 GMT 2019 - 4.7K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/HttpsServer.java
HandshakeCertificates clientCertificates = new HandshakeCertificates.Builder() .addTrustedCertificate(localhostCertificate.certificate()) .build(); OkHttpClient client = new OkHttpClient.Builder() .sslSocketFactory(clientCertificates.sslSocketFactory(), clientCertificates.trustManager()) .build(); Call call = client.newCall(new Request.Builder() .url(server.url("/"))
Java - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Mon Jan 02 14:04:37 GMT 2023 - 2.1K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/PostFile.java
public static final MediaType MEDIA_TYPE_MARKDOWN = MediaType.get("text/x-markdown; charset=utf-8"); private final OkHttpClient client = new OkHttpClient(); public void run() throws Exception { File file = new File("README.md"); Request request = new Request.Builder() .url("https://api.github.com/markdown/raw") .post(RequestBody.create(file, MEDIA_TYPE_MARKDOWN)) .build();
Java - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Sat May 25 18:02:55 GMT 2019 - 1.5K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/PostStreaming.java
public final class PostStreaming { public static final MediaType MEDIA_TYPE_MARKDOWN = MediaType.get("text/x-markdown; charset=utf-8"); private final OkHttpClient client = new OkHttpClient(); public void run() throws Exception { RequestBody requestBody = new RequestBody() { @Override public MediaType contentType() { return MEDIA_TYPE_MARKDOWN; }
Java - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Fri Jul 06 03:18:15 GMT 2018 - 2.1K bytes - Viewed (0) -
samples/slack/src/main/java/okhttp3/slack/SlackApi.java
public final String clientSecret; public final int port; public SlackApi(String clientId, String clientSecret, int port) { this.httpClient = new OkHttpClient.Builder() .build(); this.moshi = new Moshi.Builder() .add(new SlackJsonAdapters()) .build(); this.clientId = clientId; this.clientSecret = clientSecret; this.port = port; }
Java - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Fri Jul 06 19:30:55 GMT 2018 - 4.4K bytes - Viewed (1) -
samples/guide/src/main/java/okhttp3/recipes/ConfigureTimeouts.java
public ConfigureTimeouts() throws Exception { client = new OkHttpClient.Builder() .connectTimeout(5, TimeUnit.SECONDS) .writeTimeout(5, TimeUnit.SECONDS) .readTimeout(5, TimeUnit.SECONDS) .callTimeout(10, TimeUnit.SECONDS) .build(); } public void run() throws Exception { Request request = new Request.Builder()
Java - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Sat Sep 28 18:00:26 GMT 2019 - 1.5K bytes - Viewed (0) -
samples/unixdomainsockets/src/main/java/okhttp3/unixdomainsockets/UnixDomainSocketFactory.java
UnixSocketChannel channel = UnixSocketChannel.open(); return new TunnelingUnixSocket(path, channel); } @Override public Socket createSocket(String host, int port) throws IOException { Socket result = createSocket(); try { result.connect(new InetSocketAddress(host, port)); } catch (IOException e) { result.close(); throw e; }
Java - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Sun Dec 03 21:33:52 GMT 2023 - 2.1K bytes - Viewed (0) -
regression-test/src/androidTest/java/okhttp/regression/IssueReproductionTest.java
public class IssueReproductionTest { @Test public void getFailsWithoutAdditionalCert() throws IOException { OkHttpClient client = new OkHttpClient(); sendRequest(client, "https://google.com/robots.txt"); } private void sendRequest(OkHttpClient client, String url) throws IOException { Request request = new Request.Builder() .url(url) .build(); try (Response response = client.newCall(request).execute()) {
Java - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Mon Jul 26 06:37:08 GMT 2021 - 1.9K bytes - Viewed (0) -
samples/unixdomainsockets/src/main/java/okhttp3/unixdomainsockets/ClientAndServer.java
public void run() throws Exception { File socketFile = new File("/tmp/ClientAndServer.sock"); socketFile.delete(); // Clean up from previous runs. MockWebServer server = new MockWebServer(); server.setServerSocketFactory(new UnixDomainServerSocketFactory(socketFile)); server.setProtocols(Collections.singletonList(Protocol.H2_PRIOR_KNOWLEDGE)); server.enqueue(new MockResponse().setBody("hello")); server.start();
Java - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Mon Dec 24 03:46:30 GMT 2018 - 2.1K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/CertificatePinning.java
public final class CertificatePinning { private final OkHttpClient client = new OkHttpClient.Builder() .certificatePinner( new CertificatePinner.Builder() .add("publicobject.com", "sha256/Vjs8r4z+80wjNcr1YKepWQboSIRi63WsWXhIMN+eWys=") .build()) .build(); public void run() throws Exception { Request request = new Request.Builder() .url("https://publicobject.com/robots.txt")
Java - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Sun Dec 08 21:30:01 GMT 2019 - 1.7K bytes - Viewed (0)