- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 296 for exception (0.16 sec)
-
okhttp/src/main/kotlin/okhttp3/Interceptor.kt
* when responses are of an unexpected type or cannot be decoded. * * Other exception types cancel the current call: * * * For synchronous calls made with [Call.execute], the exception is propagated to the caller. * * * For asynchronous calls made with [Call.enqueue], an [IOException] is propagated to the caller * indicating that the call was canceled. The interceptor's exception is delivered to the current
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Mon Jan 08 01:13:22 GMT 2024 - 3.5K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/PostFile.java
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(); 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: Sat May 25 18:02:55 GMT 2019 - 1.5K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/ConfigureTimeouts.java
private final OkHttpClient client; 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/guide/src/main/java/okhttp3/recipes/PostStreaming.java
private final OkHttpClient client = new OkHttpClient(); public void run() throws Exception { RequestBody requestBody = new RequestBody() { @Override public MediaType contentType() { return MEDIA_TYPE_MARKDOWN; } @Override public void writeTo(BufferedSink sink) throws IOException { sink.writeUtf8("Numbers\n"); sink.writeUtf8("-------\n");
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) -
okhttp/src/main/kotlin/okhttp3/internal/connection/RealCall.kt
} } } internal fun failRejected(e: RejectedExecutionException? = null) { val ioException = InterruptedIOException("executor rejected") ioException.initCause(e) noMoreExchanges(ioException) responseCallback.onFailure(this@RealCall, ioException) } override fun run() { threadName("OkHttp ${redactedUrl()}") { var signalledCallback = false
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Sat Apr 20 17:03:43 GMT 2024 - 17.9K bytes - Viewed (2) -
samples/guide/src/main/java/okhttp3/recipes/HttpsServer.java
import okhttp3.tls.HandshakeCertificates; import okhttp3.tls.HeldCertificate; /** * Create an HTTPS server with a self-signed certificate that OkHttp trusts. */ public class HttpsServer { public void run() throws Exception { HeldCertificate localhostCertificate = new HeldCertificate.Builder() .addSubjectAlternativeName("localhost") .build(); HandshakeCertificates serverCertificates = new HandshakeCertificates.Builder()
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) -
okhttp/src/test/java/okhttp3/internal/publicsuffix/PublicSuffixListGenerator.kt
fileSystem.source(publicSuffixListDotDat).buffer().use { source -> while (!source.exhausted()) { var rule: ByteString = source.readUtf8LineStrict().toRule() ?: continue if (rule.startsWith(EXCEPTION_RULE_MARKER)) { rule = rule.substring(1) // We use '\n' for end of value. totalExceptionRuleBytes += rule.size + 1 sortedExceptionRules.add(rule) } else {
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Thu Apr 18 01:24:38 GMT 2024 - 6K bytes - Viewed (0) -
samples/static-server/src/main/java/okhttp3/sample/SampleServer.java
} private MockResponse fileToResponse(String path, File file) throws IOException { return new MockResponse() .setStatus("HTTP/1.1 200") .setBody(fileToBytes(file)) .addHeader("content-type: " + contentType(path)); } private Buffer fileToBytes(File file) throws IOException { Buffer result = new Buffer(); result.writeAll(Okio.source(file)); return result; }
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) -
regression-test/src/androidTest/java/okhttp/regression/compare/ApacheHttpClientHttp2Test.kt
} } } object LoggingCallback : FutureCallback<SimpleHttpResponse> { override fun completed(response: SimpleHttpResponse) { } override fun failed(ex: Exception) { println("Failed: $ex") } override fun cancelled() { println("Cancelled") }
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Mon Jan 08 01:13:22 GMT 2024 - 2.6K bytes - Viewed (0) -
okhttp-tls/src/main/kotlin/okhttp3/tls/internal/der/DerAdapter.kt
* * If this does read a value, it starts with the tag and length, and reads an entire value, * including any potential composed values. * * If there's nothing to read and no default value, this will throw an exception. */ fun fromDer(reader: DerReader): T fun fromDer(byteString: ByteString): T { val buffer = Buffer().write(byteString) val reader = DerReader(buffer) return fromDer(reader) } /**
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Mon Jan 08 01:13:22 GMT 2024 - 4.2K bytes - Viewed (0)