Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 175 for Requestbody (0.05 sec)

  1. okhttp/src/commonJvmAndroid/kotlin/okhttp3/RequestBody.kt

        @JvmField
        val EMPTY: RequestBody = ByteString.EMPTY.toRequestBody()
    
        /**
         * Returns a new request body that transmits this string. If [contentType] is non-null and lacks
         * a charset, this will use UTF-8.
         */
        @JvmStatic
        @JvmName("create")
        fun String.toRequestBody(contentType: MediaType? = null): RequestBody {
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Tue Oct 07 14:16:29 UTC 2025
    - 9.3K bytes
    - Viewed (0)
  2. okhttp/src/jvmTest/kotlin/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())
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Tue Nov 04 19:13:52 UTC 2025
    - 25.8K bytes
    - Viewed (0)
  3. okhttp/src/jvmTest/kotlin/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)
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Tue Oct 07 14:16:29 UTC 2025
    - 3.8K bytes
    - Viewed (1)
  4. samples/guide/src/main/java/okhttp3/recipes/RequestBodyCompression.java

      public void run() throws Exception {
        Map<String, String> requestBody = new LinkedHashMap<>();
        requestBody.put("longUrl", "https://publicobject.com/2014/12/04/html-formatting-javadocs/");
        RequestBody jsonRequestBody = RequestBody.create(
            mapJsonAdapter.toJson(requestBody), MEDIA_TYPE_JSON);
        Request request = new Request.Builder()
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Wed Jun 04 17:43:43 UTC 2025
    - 3.1K bytes
    - Viewed (0)
  5. okhttp/api/android/okhttp.api

    	public static synthetic fun create$default (Lokhttp3/RequestBody$Companion;Ljava/lang/String;Lokhttp3/MediaType;ILjava/lang/Object;)Lokhttp3/RequestBody;
    	public static synthetic fun create$default (Lokhttp3/RequestBody$Companion;Lokhttp3/MediaType;[BIIILjava/lang/Object;)Lokhttp3/RequestBody;
    	public static synthetic fun create$default (Lokhttp3/RequestBody$Companion;Lokio/ByteString;Lokhttp3/MediaType;ILjava/lang/Object;)Lokhttp3/RequestBody;
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Wed Nov 05 18:28:35 UTC 2025
    - 70.3K bytes
    - Viewed (0)
  6. docs/de/docs/how-to/custom-request-and-route.md

    Einige Anwendungsfälle sind:
    
    * Konvertieren von Nicht-JSON-Requestbodys nach JSON (z. B. <a href="https://msgpack.org/index.html" class="external-link" target="_blank">`msgpack`</a>).
    * Dekomprimierung gzip-komprimierter Requestbodys.
    * Automatisches Loggen aller Requestbodys.
    
    ## Handhaben von benutzerdefinierten Requestbody-Kodierungen { #handling-custom-request-body-encodings }
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 10 13:54:34 UTC 2025
    - 5.7K bytes
    - Viewed (0)
  7. samples/guide/src/main/java/okhttp3/recipes/kt/PostStreaming.kt

    import okhttp3.MediaType.Companion.toMediaType
    import okhttp3.OkHttpClient
    import okhttp3.Request
    import okhttp3.RequestBody
    import okio.BufferedSink
    
    class PostStreaming {
      private val client = OkHttpClient()
    
      fun run() {
        val requestBody =
          object : RequestBody() {
            override fun contentType() = MEDIA_TYPE_MARKDOWN
    
            override fun writeTo(sink: BufferedSink) {
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 1.9K bytes
    - Viewed (0)
  8. okhttp/src/jvmTest/kotlin/okhttp3/KotlinSourceModernTest.kt

      @Test
      fun multipartBodyPart() {
        val requestBody: RequestBody = "".toRequestBody(null)
        var part: MultipartBody.Part = MultipartBody.Part.create(null, requestBody)
        part = MultipartBody.Part.create(headersOf(), requestBody)
        part = MultipartBody.Part.create(requestBody)
        part = MultipartBody.Part.createFormData("", "")
        part = MultipartBody.Part.createFormData("", "", requestBody)
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Wed Nov 05 18:28:35 UTC 2025
    - 47K bytes
    - Viewed (0)
  9. okhttp/api/jvm/okhttp.api

    	public static synthetic fun create$default (Lokhttp3/RequestBody$Companion;Ljava/lang/String;Lokhttp3/MediaType;ILjava/lang/Object;)Lokhttp3/RequestBody;
    	public static synthetic fun create$default (Lokhttp3/RequestBody$Companion;Lokhttp3/MediaType;[BIIILjava/lang/Object;)Lokhttp3/RequestBody;
    	public static synthetic fun create$default (Lokhttp3/RequestBody$Companion;Lokio/ByteString;Lokhttp3/MediaType;ILjava/lang/Object;)Lokhttp3/RequestBody;
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Wed Nov 05 18:28:35 UTC 2025
    - 70.2K bytes
    - Viewed (0)
  10. samples/guide/src/main/java/okhttp3/recipes/kt/UploadProgress.kt

            }
          }
    
        val file = File("docs/images/logo-square.png")
        val requestBody: RequestBody = file.asRequestBody(MEDIA_TYPE_PNG)
    
        val request =
          Request
            .Builder()
            .header("Authorization", "Client-ID $IMGUR_CLIENT_ID")
            .url("https://api.imgur.com/3/image")
            .post(ProgressRequestBody(requestBody, progressListener))
            .build()
    
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Sat Aug 30 17:01:12 UTC 2025
    - 3.8K bytes
    - Viewed (0)
Back to top