Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 120 for MediaType (0.14 sec)

  1. okhttp/src/main/kotlin/okhttp3/ResponseBody.kt

        @JvmStatic
        @JvmName("create")
        fun ByteArray.toResponseBody(contentType: MediaType? = null): ResponseBody = commonToResponseBody(contentType)
    
        /** Returns a new response body that transmits this byte string. */
        @JvmStatic
        @JvmName("create")
        fun ByteString.toResponseBody(contentType: MediaType? = null): ResponseBody = commonToResponseBody(contentType)
    
    Registered: Sun Jun 16 04:42:17 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 10.7K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apiserver/pkg/endpoints/handlers/negotiation/negotiate_test.go

    	var out []runtime.SerializerInfo
    	for _, s := range n.types {
    		mediaType, _, err := mime.ParseMediaType(s)
    		if err != nil {
    			panic(err)
    		}
    		parts := strings.SplitN(mediaType, "/", 2)
    		if len(parts) == 1 {
    			// this is an error on the server side
    			parts = append(parts, "")
    		}
    
    		info := runtime.SerializerInfo{
    			Serializer:       n.serializer,
    			MediaType:        s,
    			MediaTypeType:    parts[0],
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Oct 10 10:53:34 UTC 2019
    - 9K bytes
    - Viewed (0)
  3. platforms/documentation/docs/src/samples/templates/structuring-software-projects/server-application/app/src/main/java/com/example/myproduct/server/MyProductJsonController.java

    import com.example.myproduct.user.table.TableBuilder;
    
    import org.springframework.http.MediaType;
    import org.springframework.web.bind.annotation.RequestMapping;
    import org.springframework.web.bind.annotation.RestController;
    
    import java.util.List;
    
    @RestController
    public class MyProductJsonController {
    
        @RequestMapping(value = "/json", produces = MediaType.APPLICATION_JSON_VALUE)
        public List<List<String>> json() {
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Mon Nov 27 17:53:42 UTC 2023
    - 511 bytes
    - Viewed (0)
  4. okhttp/src/test/java/okhttp3/MediaTypeGetTest.kt

     * limitations under the License.
     */
    package okhttp3
    
    import kotlin.test.assertEquals
    import kotlin.test.assertFailsWith
    import okhttp3.MediaType.Companion.toMediaType
    
    open class MediaTypeGetTest : MediaTypeTest() {
      override fun parse(string: String): MediaType = string.toMediaType()
    
      override fun assertInvalid(
        string: String,
        exceptionMessage: String?,
      ) {
        val e =
    Registered: Sun Jun 16 04:42:17 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 1.1K bytes
    - Viewed (0)
  5. samples/guide/src/main/java/okhttp3/guide/PostExample.java

     * limitations under the License.
     */
    package okhttp3.guide;
    
    import java.io.IOException;
    import okhttp3.MediaType;
    import okhttp3.OkHttpClient;
    import okhttp3.Request;
    import okhttp3.RequestBody;
    import okhttp3.Response;
    
    public class PostExample {
      public static final MediaType JSON = MediaType.get("application/json; charset=utf-8");
    
      final OkHttpClient client = new OkHttpClient();
    
    Registered: Sun Jun 16 04:42:17 UTC 2024
    - Last Modified: Fri Apr 05 03:30:42 UTC 2024
    - 2K bytes
    - Viewed (0)
  6. src/mime/example_test.go

    	// HELLO WORLD!
    }
    
    func ExampleFormatMediaType() {
    	mediatype := "text/html"
    	params := map[string]string{
    		"charset": "utf-8",
    	}
    
    	result := mime.FormatMediaType(mediatype, params)
    
    	fmt.Println("result:", result)
    	// Output:
    	// result: text/html; charset=utf-8
    }
    
    func ExampleParseMediaType() {
    	mediatype, params, err := mime.ParseMediaType("text/html; charset=utf-8")
    	if err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 20 18:41:18 UTC 2020
    - 2.9K bytes
    - Viewed (0)
  7. samples/guide/src/main/java/okhttp3/recipes/RequestBodyCompression.java

       *
       * https://console.developers.google.com/project
       */
      public static final String GOOGLE_API_KEY = "AIzaSyAx2WZYe0My0i-uGurpvraYJxO7XNbwiGs";
      public static final MediaType MEDIA_TYPE_JSON = MediaType.get("application/json");
    
      private final OkHttpClient client = new OkHttpClient.Builder()
          .addInterceptor(new GzipRequestInterceptor())
          .build();
    Registered: Sun Jun 16 04:42:17 UTC 2024
    - Last Modified: Sat May 25 18:02:55 UTC 2019
    - 3.8K bytes
    - Viewed (0)
  8. okhttp/src/test/java/okhttp3/CommonRequestBodyTest.kt

    class CommonRequestBodyTest {
      @Test
      fun correctContentType() {
        val body = "Body"
        val requestBody = body.toRequestBody(MediaType("text/plain", "text", "plain", arrayOf()))
    
        val contentType = requestBody.contentType()!!
    
        assertThat(contentType.mediaType).isEqualTo("text/plain; charset=utf-8")
        assertThat(contentType.parameter("charset")).isEqualTo("utf-8")
      }
    Registered: Sun Jun 16 04:42:17 UTC 2024
    - Last Modified: Wed Dec 20 23:27:07 UTC 2023
    - 1.1K bytes
    - Viewed (0)
  9. samples/guide/src/main/java/okhttp3/recipes/PostMultipart.java

       * these examples, please request your own client ID! https://api.imgur.com/oauth2
       */
      private static final String IMGUR_CLIENT_ID = "9199fdef135c122";
      private static final MediaType MEDIA_TYPE_PNG = MediaType.get("image/png");
    
      private final OkHttpClient client = new OkHttpClient();
    
      public void run() throws Exception {
        // Use the imgur image upload API as documented at https://api.imgur.com/endpoints/image
    Registered: Sun Jun 16 04:42:17 UTC 2024
    - Last Modified: Mon Jun 24 12:59:42 UTC 2019
    - 2.2K bytes
    - Viewed (0)
  10. okhttp/src/test/java/okhttp3/KotlinDeprecationErrorTest.kt

        val keyPair: KeyPair = heldCertificate.keyPair()
      }
    
      @Test @Disabled
      fun mediaType() {
        val mediaType: MediaType = MediaType.get("")
        val type: String = mediaType.type()
        val subtype: String = mediaType.subtype()
        val parse: MediaType? = MediaType.parse("")
      }
    
      @Test @Disabled
      fun mockResponse() {
        val mockResponse = MockResponse()
    Registered: Sun Jun 16 04:42:17 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 13.3K bytes
    - Viewed (0)
Back to top