- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 75 for requestBody (0.18 sec)
-
okhttp/src/main/kotlin/okhttp3/RequestBody.kt
offset: Int = 0, byteCount: Int = size, ): RequestBody = commonToRequestBody(contentType, offset, byteCount) /** Returns a new request body that transmits the content of this. */ @JvmStatic @JvmName("create") fun File.asRequestBody(contentType: MediaType? = null): RequestBody { return object : RequestBody() { override fun contentType() = contentType
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Thu Jan 25 14:41:37 GMT 2024 - 9.6K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/DuplexTest.kt
) call.execute().use { response -> val requestBody = (call.request().body as AsyncRequestBody?)!!.takeSink() requestBody.writeUtf8("request A\n") requestBody.flush() val responseBody = response.body.source() assertThat(responseBody.readUtf8Line()) .isEqualTo("response B") requestBody.writeUtf8("request C\n") requestBody.flush() assertThat(responseBody.readUtf8Line())
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Sat Jan 20 10:30:28 GMT 2024 - 23.9K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/RequestBodyTest.kt
assertOnFileDescriptor { fd -> val requestBody = fd.toRequestBody() assertThat(requestBody.contentLength()).isEqualTo(-1L) assertThat(requestBody.isOneShot()).isEqualTo(true) } } @Test fun testFileDescriptorRead() { assertOnFileDescriptor(content = "Hello") { fd -> val requestBody = fd.toRequestBody() val buffer = Buffer() requestBody.writeTo(buffer)
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Mon Jan 08 01:13:22 GMT 2024 - 3.6K bytes - Viewed (1) -
okhttp/api/okhttp.api
public final fun create (Lokhttp3/MediaType;[BI)Lokhttp3/RequestBody; public final fun create (Lokhttp3/MediaType;[BII)Lokhttp3/RequestBody; public final fun create (Lokio/ByteString;Lokhttp3/MediaType;)Lokhttp3/RequestBody; public final fun create (Lokio/Path;Lokio/FileSystem;Lokhttp3/MediaType;)Lokhttp3/RequestBody; public final fun create ([B)Lokhttp3/RequestBody; public final fun create ([BLokhttp3/MediaType;)Lokhttp3/RequestBody;
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Mon Apr 15 13:41:01 GMT 2024 - 70.2K bytes - Viewed (0) -
okhttp-logging-interceptor/src/main/kotlin/okhttp3/logging/HttpLoggingInterceptor.kt
val requestBody = request.body val connection = chain.connection() var requestStartMessage = ("--> ${request.method} ${redactUrl(request.url)}${if (connection != null) " " + connection.protocol() else ""}") if (!logHeaders && requestBody != null) { requestStartMessage += " (${requestBody.contentLength()}-byte body)" }
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/test/java/okhttp3/ServerTruncatesRequestTest.kt
), ) val requestBody = AsyncRequestBody() val call = client.newCall( Request( url = server.url("/"), body = requestBody, ), ) call.execute().use { response -> assertThat(response.body.string()).isEqualTo("abc") val requestBodyOut = requestBody.takeSink() assertFailsWith<IOException> {
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/src/test/java/okhttp3/internal/http/ThreadInterruptTest.kt
import kotlin.test.assertFailsWith import okhttp3.DelegatingServerSocketFactory import okhttp3.DelegatingSocketFactory import okhttp3.OkHttpClient import okhttp3.OkHttpClientTestRule import okhttp3.Request import okhttp3.RequestBody import okhttp3.mockwebserver.MockResponse import okhttp3.mockwebserver.MockWebServer import okhttp3.testing.PlatformRule import okio.Buffer import okio.BufferedSink import org.junit.jupiter.api.AfterEach
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Mon Jan 08 01:13:22 GMT 2024 - 4.6K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/kt/PostPath.kt
* limitations under the License. */ package okhttp3.recipes.kt import java.io.IOException import okhttp3.MediaType.Companion.toMediaType import okhttp3.OkHttpClient import okhttp3.Request import okhttp3.RequestBody.Companion.asRequestBody import okio.Path.Companion.toPath import okio.buffer import okio.fakefilesystem.FakeFileSystem class PostPath { private val client = OkHttpClient()
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/URLConnectionTest.kt
getResponse( Request( url = server.url("/b"), body = requestBody, ), ) } } @Test fun fullyBufferedPostIsTooLong() { server.enqueue( MockResponse(body = "A"), ) val requestBody: RequestBody = object : RequestBody() { override fun contentType(): MediaType? = null
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) -
mockwebserver/src/main/kotlin/mockwebserver3/internal/duplex/RealStream.kt
import okio.buffer /** Adapt OkHttp's internal [Http2Stream] type to the public [Stream] type. */ internal class RealStream( private val http2Stream: Http2Stream, ) : Stream { override val requestBody = http2Stream.getSource().buffer() override val responseBody = http2Stream.getSink().buffer() override fun cancel() { http2Stream.closeLater(ErrorCode.CANCEL) }
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Sat Dec 31 18:24:52 GMT 2022 - 1.1K bytes - Viewed (0)