- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 156 for body (0.26 sec)
-
okhttp/src/test/java/okhttp3/ResponseBodyJvmTest.kt
class ResponseBodyJvmTest { @Test fun stringEmpty() { val body = body("") assertThat(body.string()).isEqualTo("") } @Test fun stringLooksLikeBomButTooShort() { val body = body("000048") assertThat(body.string()).isEqualTo("\u0000\u0000H") } @Test fun stringDefaultsToUtf8() { val body = body("68656c6c6f") assertThat(body.string()).isEqualTo("hello") } @Test
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Mon Jan 08 01:13:22 GMT 2024 - 13K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/URLConnectionTest.kt
Request( url = server.url("/"), body = body.toRequestBody(), ), ) assertThat(response.code).isEqualTo(200) response.body.byteStream().close() val recordedRequest1 = server.takeRequest() assertThat(recordedRequest1.method).isEqualTo("POST") assertThat(recordedRequest1.body.readUtf8()).isEqualTo(body) assertThat(recordedRequest1.headers["Authorization"]).isNull()
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Sat Jan 20 10:30:28 GMT 2024 - 131.7K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/ServerTruncatesRequestTest.kt
server.enqueue( MockResponse( body = "abc", socketPolicy = DoNotReadRequestBody(ErrorCode.NO_ERROR.httpCode), ), ) val call = client.newCall( Request( url = server.url("/"), body = SlowRequestBody, ), ) call.execute().use { response -> assertThat(response.body.string()).isEqualTo("abc") }
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Mon Jan 08 01:13:22 GMT 2024 - 9.5K bytes - Viewed (0) -
okhttp-logging-interceptor/src/main/kotlin/okhttp3/logging/HttpLoggingInterceptor.kt
logger.log("--> END ${request.method} (encoded body omitted)") } else if (requestBody.isDuplex()) { logger.log("--> END ${request.method} (duplex request body omitted)") } else if (requestBody.isOneShot()) { logger.log("--> END ${request.method} (one-shot body omitted)") } else { var buffer = Buffer() requestBody.writeTo(buffer)
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Sat Apr 06 09:14:38 GMT 2024 - 11.2K bytes - Viewed (1) -
okhttp/src/main/kotlin/okhttp3/Callback.kt
* proceed to read the response body with [Response.body]. The response is still live until its * response body is [closed][ResponseBody]. The recipient of the callback may consume the response * body on another thread. * * Note that transport-layer success (receiving a HTTP response code, headers and body) does not
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Mon Jan 08 01:13:22 GMT 2024 - 1.6K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/internal/http/ExternalHttp2Example.kt
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Mon Jan 08 01:13:22 GMT 2024 - 1.4K bytes - Viewed (0) -
mockwebserver/README.md
``` Your unit tests might move the `server` into a field so you can shut it down from your test's `tearDown()`. ### API #### MockResponse Mock responses default to an empty response body and a `200` status code. You can set a custom body with a string, input stream or byte array. Also add headers with a fluent builder API. ```java MockResponse response = new MockResponse()
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Sun Dec 17 15:34:10 GMT 2023 - 5K bytes - Viewed (1) -
samples/compare/src/test/kotlin/okhttp3/compare/JavaHttpClientTest.kt
MockResponse.Builder() .body("hello, Java HTTP Client") .build(), ) val request = 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")
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Mon Jan 08 01:13:22 GMT 2024 - 2.7K bytes - Viewed (0) -
okhttp/src/main/kotlin/okhttp3/internal/connection/RealCall.kt
// the call, but they may be accessed by other threads for duplex requests. /** True if this call still has a request body open. */ private var requestBodyOpen = false /** True if this call still has a response body open. */ private var responseBodyOpen = false /** True if there are more exchanges expected for this call. */ private var expectMoreExchanges = true
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) -
docs/changelogs/changelog_4x.md
```kotlin val response: Response = call.execute() val multipartReader = MultipartReader(response.body!!) multipartReader.use { while (true) { val part = multipartReader.nextPart() ?: break process(part.headers, part.body) } } ``` * New: `MediaType.parameter()` gets a parameter like `boundary` from a media type like
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Wed Apr 17 13:25:31 GMT 2024 - 25.2K bytes - Viewed (0)