Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for toHeaders (2.4 sec)

  1. okhttp/src/test/java/okhttp3/HeadersTest.kt

        assertFailsWith<IllegalArgumentException> {
          mapOf("" to "OkHttp").toHeaders()
        }
      }
    
      @Test fun ofMapThrowsOnBlankName() {
        assertFailsWith<IllegalArgumentException> {
          mapOf(" " to "OkHttp").toHeaders()
        }
      }
    
      @Test fun ofMapAcceptsEmptyValue() {
        val headers = mapOf("User-Agent" to "").toHeaders()
        assertThat(headers.value(0)).isEqualTo("")
      }
    
      @Test fun ofMapTrimsKey() {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 8.6K bytes
    - Viewed (0)
  2. okhttp/src/main/kotlin/okhttp3/Headers.kt

        @JvmName("of")
        fun Map<String, String>.toHeaders(): Headers = commonToHeaders()
    
        @JvmName("-deprecated_of")
        @Deprecated(
          message = "function moved to extension",
          replaceWith = ReplaceWith(expression = "headers.toHeaders()"),
          level = DeprecationLevel.ERROR,
        )
        fun of(headers: Map<String, String>): Headers {
          return headers.toHeaders()
        }
      }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 11.5K bytes
    - Viewed (0)
  3. okhttp/src/test/java/okhttp3/HeadersJvmTest.kt

    import assertk.assertThat
    import assertk.assertions.containsExactly
    import assertk.assertions.isEqualTo
    import java.time.Instant
    import java.util.Date
    import kotlin.test.assertFailsWith
    import okhttp3.Headers.Companion.toHeaders
    import okhttp3.internal.EMPTY_HEADERS
    import org.junit.jupiter.api.Test
    
    class HeadersJvmTest {
      @Test fun byteCount() {
        assertThat(EMPTY_HEADERS.byteCount()).isEqualTo(0L)
        assertThat(
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 5.6K bytes
    - Viewed (0)
  4. okhttp/src/main/kotlin/okhttp3/internal/http2/Http2Connection.kt

    import okhttp3.internal.okHttpName
    import okhttp3.internal.peerName
    import okhttp3.internal.platform.Platform
    import okhttp3.internal.platform.Platform.Companion.INFO
    import okhttp3.internal.toHeaders
    import okio.Buffer
    import okio.BufferedSink
    import okio.BufferedSource
    import okio.ByteString
    import okio.buffer
    import okio.sink
    import okio.source
    
    /**
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 20 17:03:43 GMT 2024
    - 32.6K bytes
    - Viewed (0)
  5. okhttp/src/main/kotlin/okhttp3/internal/-UtilJvm.kt

      require(millis <= Integer.MAX_VALUE) { "$name too large" }
      require(millis != 0L || !duration.isPositive()) { "$name too small" }
      return millis.toInt()
    }
    
    internal fun List<Header>.toHeaders(): Headers {
      val builder = Headers.Builder()
      for ((name, value) in this) {
        builder.addLenient(name.utf8(), value.utf8())
      }
      return builder.build()
    }
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Tue Jan 09 12:33:05 GMT 2024
    - 10.5K bytes
    - Viewed (0)
  6. okhttp/src/test/java/okhttp3/KotlinSourceModernTest.kt

    import javax.net.ssl.X509KeyManager
    import javax.net.ssl.X509TrustManager
    import okhttp3.Handshake.Companion.handshake
    import okhttp3.Headers.Companion.headersOf
    import okhttp3.Headers.Companion.toHeaders
    import okhttp3.HttpUrl.Companion.toHttpUrl
    import okhttp3.HttpUrl.Companion.toHttpUrlOrNull
    import okhttp3.MediaType.Companion.toMediaType
    import okhttp3.MediaType.Companion.toMediaTypeOrNull
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Apr 01 14:21:25 GMT 2024
    - 46.5K bytes
    - Viewed (4)
  7. cmd/httprange.go

    		return ""
    	}
    	off, length, err := h.GetOffsetLength(resourceSize)
    	if err != nil {
    		return ""
    	}
    	return fmt.Sprintf("%d-%d", off, off+length-1)
    }
    
    // ToHeader returns the Range header value.
    func (h *HTTPRangeSpec) ToHeader() (string, error) {
    	if h == nil {
    		return "", nil
    	}
    	start := strconv.Itoa(int(h.Start))
    	end := strconv.Itoa(int(h.End))
    	switch {
    	case h.Start >= 0 && h.End >= 0:
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Sun May 05 16:56:21 GMT 2024
    - 5.9K bytes
    - Viewed (0)
  8. cmd/httprange_test.go

    		if err != nil {
    			if !testCase.errExpected || err == nil && testCase.errExpected {
    				t.Errorf("unexpected err: %v", err)
    			}
    			continue
    		}
    		h, err := rs.ToHeader()
    		if err != nil && !testCase.errExpected || err == nil && testCase.errExpected {
    			t.Errorf("expected error with invalid range: %v", err)
    		}
    		if h != testCase.spec {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Sun May 05 16:56:21 GMT 2024
    - 3.7K bytes
    - Viewed (0)
  9. cmd/bucket-replication.go

    		Internal: minio.AdvancedGetOptions{
    			ReplicationProxyRequest: "true",
    		},
    		PartNumber: opts.PartNumber,
    	}
    	// get correct offsets for encrypted object
    	if rs != nil {
    		h, err := rs.ToHeader()
    		if err != nil {
    			return nil, proxy, err
    		}
    		gopts.Set(xhttp.Range, h)
    	}
    	// Make sure to match ETag when proxying.
    	if err = gopts.SetMatchETag(oi.ETag); err != nil {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Wed May 01 01:09:56 GMT 2024
    - 112.2K bytes
    - Viewed (1)
Back to top