Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 41 for contentTypes (0.27 sec)

  1. okhttp/src/main/kotlin/okhttp3/internal/-RequestBodyCommon.kt

    import okio.BufferedSink
    import okio.ByteString
    
    fun ByteArray.commonToRequestBody(
      contentType: MediaType?,
      offset: Int,
      byteCount: Int,
    ): RequestBody {
      checkOffsetAndCount(size.toLong(), offset.toLong(), byteCount.toLong())
      return object : RequestBody() {
        override fun contentType() = contentType
    
        override fun contentLength() = byteCount.toLong()
    
        override fun writeTo(sink: BufferedSink) {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.7K bytes
    - Viewed (0)
  2. okhttp/src/main/kotlin/okhttp3/internal/http/BridgeInterceptor.kt

        val userRequest = chain.request()
        val requestBuilder = userRequest.newBuilder()
    
        val body = userRequest.body
        if (body != null) {
          val contentType = body.contentType()
          if (contentType != null) {
            requestBuilder.header("Content-Type", contentType.toString())
          }
    
          val contentLength = body.contentLength()
          if (contentLength != -1L) {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4.2K bytes
    - Viewed (2)
  3. okcurl/src/test/kotlin/okhttp3/curl/MainTest.kt

        val body = request.body
        assertThat(request.method).isEqualTo("POST")
        assertThat(request.url.toString()).isEqualTo("http://example.com/")
        assertThat(body!!.contentType().toString()).isEqualTo(
          "application/x-www-form-urlencoded; charset=utf-8",
        )
        assertThat(bodyAsString(body)).isEqualTo("foo")
      }
    
      @Test
      fun dataPut() {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4.3K bytes
    - Viewed (0)
  4. src/test/java/org/codelibs/core/net/MimeTypeUtilTest.java

            final String contentType = MimeTypeUtil.guessContentType(path);
            assertEquals("text/html", contentType);
        }
    
        /**
         * @throws Exception
         */
        @Test
        public void testGetFromStream_gif() throws Exception {
            final String path = ClassUtil.getPackageName(this.getClass()).replaceAll("\\.", "/") + "/ccc.gif";
            final String contentType = MimeTypeUtil.guessContentType(path);
    Java
    - Registered: Fri May 03 20:58:11 GMT 2024
    - Last Modified: Thu Mar 07 01:59:08 GMT 2024
    - 2.7K bytes
    - Viewed (0)
  5. okhttp-testing-support/src/main/kotlin/okhttp3/ForwardingResponseBody.kt

    open class ForwardingResponseBody(delegate: ResponseBody?) : ResponseBody() {
      private val delegate: ResponseBody
    
      fun delegate(): ResponseBody {
        return delegate
      }
    
      override fun contentType(): MediaType? {
        return delegate.contentType()
      }
    
      override fun contentLength(): Long {
        return delegate.contentLength()
      }
    
      override fun source(): BufferedSource {
        return delegate.source()
      }
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.2K bytes
    - Viewed (0)
  6. okhttp-testing-support/src/main/kotlin/okhttp3/ForwardingRequestBody.kt

    open class ForwardingRequestBody(delegate: RequestBody?) : RequestBody() {
      private val delegate: RequestBody
    
      fun delegate(): RequestBody {
        return delegate
      }
    
      override fun contentType(): MediaType? {
        return delegate.contentType()
      }
    
      @Throws(IOException::class)
      override fun contentLength(): Long {
        return delegate.contentLength()
      }
    
      @Throws(IOException::class)
    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)
  7. okhttp/src/main/kotlin/okhttp3/internal/-ResponseBodyCommon.kt

    internal fun ByteArray.commonToResponseBody(contentType: MediaType?): ResponseBody {
      return Buffer()
        .write(this)
        .asResponseBody(contentType, size.toLong())
    }
    
    internal fun ByteString.commonToResponseBody(contentType: MediaType?): ResponseBody {
      return Buffer()
        .write(this)
        .asResponseBody(contentType, size.toLong())
    }
    
    internal fun BufferedSource.commonAsResponseBody(
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2.3K bytes
    - Viewed (0)
  8. okhttp/src/test/java/okhttp3/ResponseBodyTest.kt

        assertThat(source.readUtf8()).isEqualTo("")
      }
    
      @Test
      fun sourceClosesUnderlyingSource() {
        var closed = false
    
        val body: ResponseBody =
          object : ResponseBody() {
            override fun contentType(): MediaType? {
              return null
            }
    
            override fun contentLength(): Long {
              return 5
            }
    
            override fun source(): BufferedSource {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4K bytes
    - Viewed (0)
  9. okhttp/src/test/java/okhttp3/RequestBodyTest.kt

          val requestBody = fd.toRequestBody()
    
          assertThat(requestBody.contentType()).isNull()
        }
      }
    
      @Test
      fun testFileDescriptorMediaType() {
        assertOnFileDescriptor { fd ->
          val contentType = "text/plain".toMediaType()
    
          val requestBody = fd.toRequestBody(contentType)
    
          assertThat(requestBody.contentType()).isEqualTo(contentType)
        }
      }
    
      @Test
      fun testFileDescriptorReadTwice() {
    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)
  10. src/test/java/org/codelibs/fess/it/ITBase.java

            if (testToken != null) {
                return;
            }
            given().contentType("application/json").delete(getEsUrl() + "/fess_config.access_token/_doc/" + DEFAULT_TEST_TOKEN_ID);
        }
    
        public static void refresh() {
            given().contentType("application/json").post(getEsUrl() + "/_refresh");
        }
    
        public static String getFessUrl() {
    Java
    - Registered: Mon May 06 08:04:11 GMT 2024
    - Last Modified: Thu Feb 22 01:37:57 GMT 2024
    - 3.3K bytes
    - Viewed (0)
Back to top