- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 176 for accept (0.2 sec)
-
samples/compare/src/test/kotlin/okhttp3/compare/ApacheHttpClientTest.kt
val request = HttpGet(server.url("/").toUri()) request.addHeader("Accept", "text/plain") httpClient.execute(request).use { response -> assertThat(response.code).isEqualTo(200) assertThat(EntityUtils.toString(response.entity)).isEqualTo("hello, Apache HttpClient 5.x") } val recorded = server.takeRequest() assertThat(recorded.headers["Accept"]).isEqualTo("text/plain")
Plain Text - Registered: Fri Apr 26 11:42:10 GMT 2024 - Last Modified: Mon Jan 08 01:13:22 GMT 2024 - 2.1K bytes - Viewed (0) -
samples/compare/src/test/kotlin/okhttp3/compare/JavaHttpClientTest.kt
HttpRequest.newBuilder(server.url("/").toUri()) .header("Accept", "text/plain") .build() val response = httpClient.send(request, BodyHandlers.ofString()) assertThat(response.statusCode()).isEqualTo(200) assertThat(response.body()).isEqualTo("hello, Java HTTP Client") val recorded = server.takeRequest() assertThat(recorded.headers["Accept"]).isEqualTo("text/plain")
Plain Text - Registered: Fri Apr 26 11:42:10 GMT 2024 - Last Modified: Mon Jan 08 01:13:22 GMT 2024 - 2.7K bytes - Viewed (0) -
okhttp-sse/src/main/kotlin/okhttp3/sse/EventSources.kt
@JvmStatic fun createFactory(callFactory: Call.Factory): EventSource.Factory { return EventSource.Factory { request, listener -> val actualRequest = if (request.header("Accept") == null) { request.newBuilder().addHeader("Accept", "text/event-stream").build() } else { request } RealEventSource(actualRequest, listener).apply { connect(callFactory) } }
Plain Text - Registered: Fri Apr 26 11:42:10 GMT 2024 - Last Modified: Sat Apr 06 04:18:15 GMT 2024 - 1.6K bytes - Viewed (1) -
okhttp/src/test/java/okhttp3/internal/http2/MockHttp2Peer.kt
} } } private fun readAndWriteFrames() { check(socket == null) val socket = serverSocket!!.accept()!! this.socket = socket // Bail out now if this instance was closed while waiting for the socket to accept. synchronized(this) { if (executor.isShutdown) { socket.close() return } }
Plain Text - Registered: Fri Apr 26 11:42:10 GMT 2024 - Last Modified: Thu Apr 11 22:09:35 GMT 2024 - 8.7K bytes - Viewed (0) -
docs/changelogs/changelog_4x.md
The upcoming Android Studio runs in a JVM but has classes from Android and that confused OkHttp! * Fix: Include the header `Accept: text/event-stream` for SSE calls. This header is not added if the request already contains an `Accept` header. * Fix: Don't crash with a `NullPointerException` if a server sends a close while we're sending a ping. OkHttp had a race condition bug.
Plain Text - Registered: Fri Apr 26 11:42:10 GMT 2024 - Last Modified: Wed Apr 17 13:25:31 GMT 2024 - 25.2K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/URLConnectionTest.kt
getResponse( Request.Builder() .url(server.url("/")) .header("Accept-Encoding", "custom") .build(), ) assertThat(readAscii(response.body.byteStream(), Int.MAX_VALUE)).isEqualTo("ABCDE") val request = server.takeRequest() assertThat(request.headers["Accept-Encoding"]).isEqualTo("custom") } /**
Plain Text - Registered: Fri Apr 26 11:42:10 GMT 2024 - Last Modified: Sat Jan 20 10:30:28 GMT 2024 - 131.7K bytes - Viewed (0) -
okhttp-sse/src/test/java/okhttp3/sse/internal/EventSourceHttpTest.kt
"ResponseBodyEnd", "ConnectionReleased", "CallEnd", ) } private fun newEventSource(accept: String? = null): EventSource { val builder = Request.Builder() .url(server.url("/")) if (accept != null) { builder.header("Accept", accept) } val request = builder.build() val factory = createFactory(client)
Plain Text - Registered: Fri Apr 26 11:42:10 GMT 2024 - Last Modified: Sun Jan 14 10:20:09 GMT 2024 - 6.6K bytes - Viewed (0) -
samples/compare/src/test/kotlin/okhttp3/compare/OkHttpClientTest.kt
.url(server.url("/")) .header("Accept", "text/plain") .build() val response = client.newCall(request).execute() assertThat(response.code).isEqualTo(200) assertThat(response.body.string()).isEqualTo("hello, OkHttp") val recorded = server.takeRequest() assertThat(recorded.headers["Accept"]).isEqualTo("text/plain") assertThat(recorded.headers["Accept-Encoding"]).isEqualTo("gzip")
Plain Text - Registered: Fri Apr 26 11:42:10 GMT 2024 - Last Modified: Mon Jan 08 01:13:22 GMT 2024 - 1.8K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/CacheTest.kt
Plain Text - Registered: Fri Apr 26 11:42:10 GMT 2024 - Last Modified: Wed Apr 10 19:46:48 GMT 2024 - 108.6K bytes - Viewed (0) -
okhttp-brotli/src/main/kotlin/okhttp3/brotli/BrotliInterceptor.kt
/** * Transparent Brotli response support. * * Adds Accept-Encoding: br to request and checks (and strips) for Content-Encoding: br in * responses. n.b. this replaces the transparent gzip compression in BridgeInterceptor. */ object BrotliInterceptor : Interceptor { override fun intercept(chain: Interceptor.Chain): Response { return if (chain.request().header("Accept-Encoding") == null) { val request =
Plain Text - Registered: Fri Apr 26 11:42:10 GMT 2024 - Last Modified: Mon Jan 08 01:13:22 GMT 2024 - 1.3K bytes - Viewed (0)