Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 321 for contentType (0.08 sec)

  1. okhttp-sse/src/main/kotlin/okhttp3/sse/internal/RealEventSource.kt

          } else {
            listener.onClosed(this)
          }
        }
      }
    
      private fun ResponseBody.isEventStream(): Boolean {
        val contentType = contentType() ?: return false
        return contentType.type == "text" && contentType.subtype == "event-stream"
      }
    
      override fun onFailure(
        call: Call,
        e: IOException,
      ) {
        listener.onFailure(this, e, null)
      }
    
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 3.2K bytes
    - Viewed (0)
  2. 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() {
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 3.6K bytes
    - Viewed (0)
  3. okhttp/src/main/kotlin/okhttp3/MultipartBody.kt

                .write(COLONSPACE)
                .writeUtf8(headers.value(h))
                .write(CRLF)
            }
          }
    
          val contentType = body.contentType()
          if (contentType != null) {
            sink.writeUtf8("Content-Type: ")
              .writeUtf8(contentType.toString())
              .write(CRLF)
          }
    
          // We can't measure the body's size without the sizes of its components.
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 10.9K bytes
    - Viewed (0)
  4. okhttp/src/main/kotlin/okhttp3/internal/-ResponseCommon.kt

          | * WebSocketListener
          |(It is safe to call contentType() and contentLength() on these response bodies.)
          """.trimMargin(),
        )
      }
    
      override fun timeout() = Timeout.NONE
    
      override fun close() {
      }
    }
    
    fun Response.stripBody(): Response {
      return newBuilder()
        .body(UnreadableResponseBody(body.contentType(), body.contentLength()))
        .build()
    }
    
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Apr 15 13:24:48 UTC 2024
    - 5.2K bytes
    - Viewed (0)
  5. 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)
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 1.4K bytes
    - Viewed (0)
  6. internal/event/event.go

    type Object struct {
    	Key          string            `json:"key"`
    	Size         int64             `json:"size,omitempty"`
    	ETag         string            `json:"eTag,omitempty"`
    	ContentType  string            `json:"contentType,omitempty"`
    	UserMetadata map[string]string `json:"userMetadata,omitempty"`
    	VersionID    string            `json:"versionId,omitempty"`
    	Sequencer    string            `json:"sequencer"`
    }
    
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Tue Jun 20 00:53:08 UTC 2023
    - 3.4K bytes
    - Viewed (0)
  7. fess-crawler/src/main/java/org/codelibs/fess/crawler/extractor/impl/TikaExtractor.java

                final String pdfPassword) {
            final Metadata metadata = new Metadata();
            if (StringUtil.isNotEmpty(resourceName)) {
                metadata.set(ExtractData.RESOURCE_NAME_KEY, resourceName);
            }
            if (StringUtil.isNotBlank(contentType)) {
                metadata.set(ExtractData.CONTENT_TYPE, contentType);
            }
    Registered: Sun Nov 10 03:50:12 UTC 2024
    - Last Modified: Sat Oct 12 01:41:37 UTC 2024
    - 25K bytes
    - Viewed (0)
  8. 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() {
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 4.3K bytes
    - Viewed (0)
  9. samples/guide/src/main/java/okhttp3/recipes/RequestBodyCompression.java

              .build();
          return chain.proceed(compressedRequest);
        }
    
        private RequestBody gzip(final RequestBody body) {
          return new RequestBody() {
            @Override public MediaType contentType() {
              return body.contentType();
            }
    
            @Override public long contentLength() {
              return -1; // We don't know the compressed length in advance!
            }
    
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sat May 25 18:02:55 UTC 2019
    - 3.8K bytes
    - Viewed (0)
  10. fess-crawler/src/test/java/org/codelibs/fess/crawler/client/storage/StorageClientTest.java

                    .stream(new ByteArrayInputStream("file1".getBytes()), 5, -1).contentType("application/octet-stream").build());
            minioClient.putObject(PutObjectArgs.builder().bucket(bucketName).object("dir1/file2.txt")
                    .stream(new ByteArrayInputStream("file2".getBytes()), 5, -1).contentType("application/octet-stream").build());
    Registered: Sun Nov 10 03:50:12 UTC 2024
    - Last Modified: Thu Feb 22 01:36:27 UTC 2024
    - 13.5K bytes
    - Viewed (0)
Back to top