Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 61 for MediaType (0.25 sec)

  1. tools/docker-builder/builder/crane.go

    		var manifest v1.ImageIndex = empty.Index
    		manifest = mutate.IndexMediaType(manifest, types.DockerManifestList)
    		for idx, i := range images {
    			img := i
    			mt, err := img.MediaType()
    			if err != nil {
    				return fmt.Errorf("failed to get mediatype: %w", err)
    			}
    
    			h, err := img.Digest()
    			if err != nil {
    				return fmt.Errorf("failed to compute digest: %w", err)
    			}
    
    			size, err := img.Size()
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Jul 26 01:07:39 UTC 2023
    - 9K bytes
    - Viewed (0)
  2. samples/guide/src/main/java/okhttp3/recipes/kt/PostStreaming.kt

     * limitations under the License.
     */
    package okhttp3.recipes.kt
    
    import java.io.IOException
    import okhttp3.HttpUrl.Companion.toHttpUrl
    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() {
    Registered: Sun Jun 16 04:42:17 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 1.9K bytes
    - Viewed (0)
  3. samples/guide/src/main/java/okhttp3/recipes/kt/PostMultipart.kt

     * See the License for the specific language governing permissions and
     * limitations under the License.
     */
    package okhttp3.recipes.kt
    
    import java.io.File
    import java.io.IOException
    import okhttp3.MediaType.Companion.toMediaType
    import okhttp3.MultipartBody
    import okhttp3.OkHttpClient
    import okhttp3.Request
    import okhttp3.RequestBody.Companion.asRequestBody
    
    class PostMultipart {
      private val client = OkHttpClient()
    Registered: Sun Jun 16 04:42:17 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 2.1K bytes
    - Viewed (0)
  4. okhttp/src/test/java/okhttp3/ServerTruncatesRequestTest.kt

      fun noAttemptToReadResponseIfLoadingRequestBodyIsSourceOfFailure() {
        server.enqueue(MockResponse(body = "abc"))
    
        val requestBody =
          object : RequestBody() {
            override fun contentType(): MediaType? = null
    
            override fun writeTo(sink: BufferedSink) {
              throw IOException("boom") // Despite this exception, 'sink' is healthy.
            }
          }
    
        val callA =
          client.newCall(
    Registered: Sun Jun 16 04:42:17 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 9.5K bytes
    - Viewed (0)
  5. README.md

        return response.body().string();
      }
    }
    ```
    
    
    Post to a Server
    ----------------
    
    This program posts data to a service. [Full source][post_example].
    
    ```java
    public static final MediaType JSON = MediaType.get("application/json");
    
    OkHttpClient client = new OkHttpClient();
    
    String post(String url, String json) throws IOException {
      RequestBody body = RequestBody.create(json, JSON);
    Registered: Sun Jun 16 04:42:17 UTC 2024
    - Last Modified: Wed Dec 20 23:27:07 UTC 2023
    - 6.2K bytes
    - Viewed (0)
  6. okhttp-brotli/src/test/java/okhttp3/brotli/BrotliInterceptorTest.kt

    import assertk.assertions.contains
    import assertk.assertions.hasMessage
    import assertk.assertions.isEmpty
    import assertk.assertions.isEqualTo
    import java.io.IOException
    import kotlin.test.assertFailsWith
    import okhttp3.MediaType.Companion.toMediaType
    import okhttp3.Protocol
    import okhttp3.Request
    import okhttp3.Response
    import okhttp3.ResponseBody.Companion.toResponseBody
    import okhttp3.brotli.internal.uncompress
    import okio.ByteString
    Registered: Sun Jun 16 04:42:17 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 4.2K bytes
    - Viewed (0)
  7. okhttp/src/test/java/okhttp3/RequestBodyTest.kt

    import assertk.assertions.isEqualTo
    import assertk.assertions.isNull
    import java.io.FileDescriptor
    import java.io.FileInputStream
    import java.io.IOException
    import java.nio.file.Path
    import okhttp3.MediaType.Companion.toMediaType
    import okhttp3.RequestBody.Companion.asRequestBody
    import okhttp3.RequestBody.Companion.toRequestBody
    import okio.Buffer
    import okio.FileSystem
    import okio.Path.Companion.toOkioPath
    Registered: Sun Jun 16 04:42:17 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 3.6K bytes
    - Viewed (0)
  8. src/cmd/go/internal/web/http.go

    		Header:     map[string][]string(res.Header),
    		Body:       res.Body,
    	}
    
    	if res.StatusCode != http.StatusOK {
    		contentType := res.Header.Get("Content-Type")
    		if mediaType, params, _ := mime.ParseMediaType(contentType); mediaType == "text/plain" {
    			switch charset := strings.ToLower(params["charset"]); charset {
    			case "us-ascii", "utf-8", "":
    				// Body claims to be plain text in UTF-8 or a subset thereof.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Aug 10 17:34:27 UTC 2023
    - 9.7K bytes
    - Viewed (0)
  9. staging/src/k8s.io/apimachinery/pkg/runtime/negotiate.go

    			return nil, nil, nil, NegotiateError{ContentType: contentType, Stream: true}
    		}
    		info = mediaTypes[0]
    	}
    	if info.StreamSerializer == nil {
    		return nil, nil, nil, NegotiateError{ContentType: info.MediaType, Stream: true}
    	}
    	return n.serializer.DecoderToVersion(info.Serializer, n.decode), info.StreamSerializer.Serializer, info.StreamSerializer.Framer, nil
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Oct 29 19:55:06 UTC 2020
    - 3.7K bytes
    - Viewed (0)
  10. staging/src/k8s.io/apiserver/pkg/endpoints/handlers/delete_test.go

    }
    
    type fakeSerializer struct {
    	serializer runtime.Serializer
    }
    
    func (n *fakeSerializer) SupportedMediaTypes() []runtime.SerializerInfo {
    	return []runtime.SerializerInfo{
    		{
    			MediaType:        "application/json",
    			MediaTypeType:    "application",
    			MediaTypeSubType: "json",
    		},
    	}
    }
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Jul 03 16:16:51 UTC 2023
    - 8.2K bytes
    - Viewed (0)
Back to top