Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 419 for ContentType (0.17 sec)

  1. 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: Sun Jun 16 04:42:17 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 3.6K bytes
    - Viewed (0)
  2. testing/soak/src/integTest/groovy/org/gradle/resolve/DependencyResolutionStressTest.groovy

        static class Resource {
            final long lastModified
            final byte[] content
            final String contentType
    
            Resource(byte[] content, long lastModified, String contentType) {
                this.content = content
                this.lastModified = lastModified
                this.contentType = contentType
            }
    
            int getContentLength() {
                content.length
            }
    
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Apr 04 07:21:38 UTC 2024
    - 10.2K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apiserver/pkg/server/filters/content_type.go

    import "net/http"
    
    // WithContentType sets both the Content-Type and the X-Content-Type-Options (nosniff) header
    func WithContentType(handler http.Handler, contentType string) http.Handler {
    	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
    		w.Header().Set("Content-Type", contentType)
    		w.Header().Set("X-Content-Type-Options", "nosniff")
    		handler.ServeHTTP(w, r)
    	})
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Jan 04 23:35:32 UTC 2019
    - 983 bytes
    - Viewed (0)
  4. fess-crawler/src/main/java/org/codelibs/fess/crawler/client/http/HcHttpClient.java

                }
    
                String contentType = null;
                final Header contentTypeHeader = response.getFirstHeader("Content-Type");
                if (contentTypeHeader != null) {
                    contentType = contentTypeHeader.getValue();
                    final int idx = contentType.indexOf(';');
                    if (idx > 0) {
                        contentType = contentType.substring(0, idx);
    Registered: Wed Jun 12 15:17:51 UTC 2024
    - Last Modified: Thu May 09 09:28:25 UTC 2024
    - 41K bytes
    - Viewed (0)
  5. pkg/webhooks/validation/server/server_test.go

    	cases := []struct {
    		name            string
    		body            []byte
    		contentType     string
    		wantStatusCode  int
    		wantAllowed     bool
    		allowedResponse bool
    	}{
    		{
    			name:            "valid",
    			body:            validReview,
    			contentType:     "application/json",
    			wantAllowed:     true,
    			wantStatusCode:  http.StatusOK,
    			allowedResponse: true,
    		},
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Mar 01 01:34:15 UTC 2023
    - 9.6K bytes
    - Viewed (0)
  6. okhttp/src/test/java/okhttp3/MultipartBodyTest.kt

            .addPart("Hello, World!".toRequestBody(null))
            .build()
        assertThat(body.boundary).isEqualTo("123")
        assertThat(body.type).isEqualTo(MultipartBody.MIXED)
        assertThat(body.contentType().toString())
          .isEqualTo("multipart/mixed; boundary=123")
        assertThat(body.parts.size).isEqualTo(1)
        assertThat(body.contentLength()).isEqualTo(33L)
        val buffer = Buffer()
        body.writeTo(buffer)
    Registered: Sun Jun 16 04:42:17 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 10.4K bytes
    - Viewed (0)
  7. platforms/software/resources-http/src/main/java/org/gradle/internal/resource/transport/http/HttpResourceUploader.java

     * limitations under the License.
     */
    
    package org.gradle.internal.resource.transport.http;
    
    import org.apache.http.client.methods.HttpPut;
    import org.apache.http.entity.ContentType;
    import org.gradle.internal.resource.ExternalResourceName;
    import org.gradle.internal.resource.ReadableContent;
    import org.gradle.internal.resource.transfer.ExternalResourceUploader;
    
    import java.io.IOException;
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Oct 12 19:38:08 UTC 2023
    - 1.9K bytes
    - Viewed (0)
  8. 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()
      }
    
    Registered: Sun Jun 16 04:42:17 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 1.2K bytes
    - Viewed (0)
  9. 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: Sun Jun 16 04:42:17 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 4.3K bytes
    - Viewed (0)
  10. src/main/java/org/codelibs/fess/api/BaseApiManager.java

            return FormatType.OTHER;
        }
    
        protected void write(final String text, final String contentType, final String encoding) {
            final StringBuilder buf = new StringBuilder(50);
            if (contentType == null) {
                buf.append("text/plain");
            } else {
                buf.append(contentType);
            }
            buf.append("; charset=");
            final String enc;
            if (encoding == null) {
    Registered: Wed Jun 12 13:08:18 UTC 2024
    - Last Modified: Thu Feb 22 01:37:57 UTC 2024
    - 4.3K bytes
    - Viewed (0)
Back to top