- Sort Score
- Result 10 results
- Languages All
Results 31 - 40 of 155 for okHttpClient (0.14 sec)
-
samples/guide/src/main/java/okhttp3/guide/PostExample.java
package okhttp3.guide; import java.io.IOException; import okhttp3.MediaType; import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.RequestBody; import okhttp3.Response; public class PostExample { public static final MediaType JSON = MediaType.get("application/json; charset=utf-8"); final OkHttpClient client = new OkHttpClient(); String post(String url, String json) throws IOException {
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Fri Apr 05 03:30:42 UTC 2024 - 2K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/CheckHandshake.java
throw new IOException("Denylisted peer certificate: " + pin); } } return chain.proceed(chain.request()); } }; private final OkHttpClient client = new OkHttpClient.Builder() .addNetworkInterceptor(CHECK_HANDSHAKE_INTERCEPTOR) .build(); public void run() throws Exception { Request request = new Request.Builder()
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Apr 15 14:55:09 UTC 2024 - 2.1K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/CurrentDateHeader.java
package okhttp3.recipes; import java.io.IOException; import java.util.Date; import okhttp3.Headers; import okhttp3.Interceptor; import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.Response; public final class CurrentDateHeader { private final OkHttpClient client = new OkHttpClient.Builder() .addInterceptor(new CurrentDateInterceptor()) .build(); public void run() throws Exception {
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Wed Oct 31 15:32:50 UTC 2018 - 1.8K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/PostString.java
import java.io.IOException; import okhttp3.MediaType; import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.RequestBody; import okhttp3.Response; public final class PostString { 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 { String postBody = ""
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Sat May 25 18:02:55 UTC 2019 - 1.7K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/Authenticate.java
*/ package okhttp3.recipes; import java.io.IOException; import okhttp3.Credentials; import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.Response; public final class Authenticate { private final OkHttpClient client; public Authenticate() { client = new OkHttpClient.Builder() .authenticator((route, response) -> { if (response.request().header("Authorization") != null) {
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Thu Aug 12 07:26:27 UTC 2021 - 1.9K 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()
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 02 14:04:37 UTC 2023 - 2.1K bytes - Viewed (0) -
okhttp-sse/src/main/kotlin/okhttp3/sse/EventSources.kt
*/ package okhttp3.sse import okhttp3.Call import okhttp3.OkHttpClient import okhttp3.Response import okhttp3.sse.internal.RealEventSource object EventSources { @Deprecated( message = "required for binary-compatibility!", level = DeprecationLevel.HIDDEN, ) @JvmStatic fun createFactory(client: OkHttpClient) = createFactory(client as Call.Factory) @JvmStatic
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Sat Apr 06 04:18:15 UTC 2024 - 1.6K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/internal/http/ExternalHttp2Example.kt
* limitations under the License. */ package okhttp3.internal.http import okhttp3.OkHttpClient import okhttp3.Protocol import okhttp3.Request object ExternalHttp2Example { @JvmStatic fun main(args: Array<String>) { val client = OkHttpClient.Builder() .protocols(listOf(Protocol.HTTP_2, Protocol.HTTP_1_1)) .build() val call = client.newCall(
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 1.4K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/kt/AsynchronousGet.kt
* limitations under the License. */ package okhttp3.recipes.kt import java.io.IOException import okhttp3.Call import okhttp3.Callback import okhttp3.OkHttpClient import okhttp3.Request import okhttp3.Response class AsynchronousGet { private val client = OkHttpClient() fun run() { val request = Request.Builder() .url("http://publicobject.com/helloworld.txt") .build()
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 1.6K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/PostMultipart.java
*/ private static final String IMGUR_CLIENT_ID = "9199fdef135c122"; private static final MediaType MEDIA_TYPE_PNG = MediaType.get("image/png"); private final OkHttpClient client = new OkHttpClient(); public void run() throws Exception { // Use the imgur image upload API as documented at https://api.imgur.com/endpoints/image RequestBody requestBody = new MultipartBody.Builder()
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jun 24 12:59:42 UTC 2019 - 2.2K bytes - Viewed (0)