Search Options

Results per page
Sort
Preferred Languages
Advance

Results 81 - 90 of 115 for RequestBody (0.14 sec)

  1. docs/changelogs/changelog_2x.md

     *  New: `Headers.of(Map)` creates headers from a Map.
    
    
    ## Version 2.2.0
    
    _2014-12-30_
    
     *  **`RequestBody.contentLength()` now throws `IOException`.**
        This is a source-incompatible change. If you have code that calls
        `RequestBody.contentLength()`, your compile will break with this
        update. The change is binary-compatible, however: code compiled
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sun Feb 06 02:19:09 UTC 2022
    - 26.6K bytes
    - Viewed (0)
  2. mockwebserver/src/main/kotlin/mockwebserver3/SocketHandler.kt

    import okio.Socket
    
    /**
     * Handles a call's request and response streams directly. Use this instead of [MockResponseBody] to
     * begin sending response data before all request data has been received.
     *
     * See [okhttp3.RequestBody.isDuplex].
     */
    public interface SocketHandler {
      public fun handle(socket: Socket)
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Jun 14 16:09:26 UTC 2025
    - 940 bytes
    - Viewed (0)
  3. okcurl/src/main/kotlin/okhttp3/curl/internal/-MainCommon.kt

    @file:Suppress("ktlint:standard:filename")
    
    package okhttp3.curl.internal
    
    import java.io.IOException
    import okhttp3.MediaType
    import okhttp3.MediaType.Companion.toMediaTypeOrNull
    import okhttp3.Request
    import okhttp3.RequestBody.Companion.toRequestBody
    import okhttp3.curl.Main
    import okhttp3.internal.http.StatusLine
    import okio.sink
    
    internal fun Main.commonCreateRequest(): Request {
      val request = Request.Builder()
    
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Mar 19 19:25:20 UTC 2025
    - 2.7K bytes
    - Viewed (0)
  4. README.md

    ```java
    public static final MediaType JSON = MediaType.get("application/json");
    
    OkHttpClient client = new OkHttpClient();
    
    String post(String url, String json) throws IOException {
      RequestBody body = RequestBody.create(json, JSON);
      Request request = new Request.Builder()
          .url(url)
          .post(body)
          .build();
      try (Response response = client.newCall(request).execute()) {
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Mon Jul 28 07:33:49 UTC 2025
    - 8.8K bytes
    - Viewed (0)
  5. samples/guide/src/main/java/okhttp3/recipes/kt/PostString.kt

    package okhttp3.recipes.kt
    
    import java.io.IOException
    import okhttp3.HttpUrl.Companion.toHttpUrl
    import okhttp3.MediaType.Companion.toMediaType
    import okhttp3.OkHttpClient
    import okhttp3.Request
    import okhttp3.RequestBody.Companion.toRequestBody
    
    class PostString {
      private val client = OkHttpClient()
    
      fun run() {
        val postBody =
          """
          |Releases
          |--------
          |
          | * _1.0_ May 6, 2013
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 1.6K bytes
    - Viewed (0)
  6. 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()
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Mar 19 19:25:20 UTC 2025
    - 1.7K bytes
    - Viewed (0)
  7. okhttp/src/jvmTest/kotlin/okhttp3/CallTest.kt

        enableProtocol(Protocol.HTTP_2)
        server.enqueue(MockResponse(body = "Response 1"))
        server.enqueue(MockResponse(body = "Response 2"))
        val requestBody: RequestBody =
          object : RequestBody() {
            override fun contentType(): MediaType? = null
    
            override fun writeTo(sink: BufferedSink) {
              sink.writeUtf8("abc")
              sink.flush()
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Thu Jul 31 04:18:40 UTC 2025
    - 146.6K bytes
    - Viewed (0)
  8. okhttp/src/jvmTest/kotlin/okhttp3/WholeOperationTimeoutTest.kt

        Thread.sleep(250)
        response.body.source().readUtf8()
        response.close()
        assertThat(call.isCanceled()).isFalse()
      }
    
      private fun sleepingRequestBody(sleepMillis: Int): RequestBody =
        object : RequestBody() {
          override fun contentType(): MediaType? = "text/plain".toMediaTypeOrNull()
    
          @Throws(IOException::class)
          override fun writeTo(sink: BufferedSink) {
            try {
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Jun 18 12:28:21 UTC 2025
    - 10.6K bytes
    - Viewed (0)
  9. okhttp/src/jvmTest/kotlin/okhttp3/InterceptorTest.kt

        assertFailsWith<IOException> {
          call.execute()
        }
        assertThat(callRef.get()).isSameInstanceAs(call)
      }
    
      private fun uppercase(original: RequestBody?): RequestBody =
        object : RequestBody() {
          override fun contentType(): MediaType? = original!!.contentType()
    
          override fun contentLength(): Long = original!!.contentLength()
    
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Fri Jun 20 11:46:46 UTC 2025
    - 28.2K bytes
    - Viewed (0)
  10. okhttp/src/commonJvmAndroid/kotlin/okhttp3/EventListener.kt

     *
     * This nesting is typical but not strict. For example, when calls use "Expect: continue" the
     * request body start and end events occur within the response header events. Similarly,
     * [duplex calls][RequestBody.isDuplex] interleave the request and response bodies.
     *
     * Since connections may be reused, the proxy selection, DNS, and connect events may not be present
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Tue May 27 14:58:02 UTC 2025
    - 17.4K bytes
    - Viewed (0)
Back to top