Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 25 for Media (0.15 sec)

  1. samples/guide/src/main/java/okhttp3/recipes/PostFile.java

      public static final MediaType MEDIA_TYPE_MARKDOWN
          = MediaType.get("text/x-markdown; charset=utf-8");
    
      private final OkHttpClient client = new OkHttpClient();
    
      public void run() throws Exception {
        File file = new File("README.md");
    
        Request request = new Request.Builder()
            .url("https://api.github.com/markdown/raw")
            .post(RequestBody.create(file, MEDIA_TYPE_MARKDOWN))
            .build();
    
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat May 25 18:02:55 GMT 2019
    - 1.5K bytes
    - Viewed (0)
  2. samples/guide/src/main/java/okhttp3/recipes/PostStreaming.java

    public final class PostStreaming {
      public static final MediaType MEDIA_TYPE_MARKDOWN
          = MediaType.get("text/x-markdown; charset=utf-8");
    
      private final OkHttpClient client = new OkHttpClient();
    
      public void run() throws Exception {
        RequestBody requestBody = new RequestBody() {
          @Override public MediaType contentType() {
            return MEDIA_TYPE_MARKDOWN;
          }
    
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Fri Jul 06 03:18:15 GMT 2018
    - 2.1K bytes
    - Viewed (0)
  3. okhttp/src/main/kotlin/okhttp3/MediaType.kt

      /**
       * Returns a specific media subtype, such as "plain" or "png", "mpeg", "mp4" or "xml".
       */
      @get:JvmName("subtype") val subtype: String,
      /** Alternating parameter names with their values, like `["charset", "utf-8"]`. */
      internal val parameterNamesAndValues: Array<String>,
    ) {
      /**
       * Returns the charset of this media type, or [defaultValue] if either this media type doesn't
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4.2K bytes
    - Viewed (0)
  4. samples/guide/src/main/java/okhttp3/recipes/kt/PostFile.kt

            body = file.asRequestBody(MEDIA_TYPE_MARKDOWN),
          )
    
        client.newCall(request).execute().use { response ->
          if (!response.isSuccessful) throw IOException("Unexpected code $response")
    
          println(response.body.string())
        }
      }
    
      companion object {
        val MEDIA_TYPE_MARKDOWN = "text/x-markdown; charset=utf-8".toMediaType()
      }
    }
    
    fun main() {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.4K bytes
    - Viewed (0)
  5. docs/recipes.md

                .post(postBody.toRequestBody(MEDIA_TYPE_MARKDOWN))
                .build()
    
            client.newCall(request).execute().use { response ->
              if (!response.isSuccessful) throw IOException("Unexpected code $response")
    
              println(response.body!!.string())
            }
          }
    
          companion object {
            val MEDIA_TYPE_MARKDOWN = "text/x-markdown; charset=utf-8".toMediaType()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Fri Feb 18 08:52:22 GMT 2022
    - 40.2K bytes
    - Viewed (1)
  6. samples/guide/src/main/java/okhttp3/recipes/kt/PostString.kt

            body = postBody.toRequestBody(MEDIA_TYPE_MARKDOWN),
          )
    
        client.newCall(request).execute().use { response ->
          if (!response.isSuccessful) throw IOException("Unexpected code $response")
    
          println(response.body.string())
        }
      }
    
      companion object {
        val MEDIA_TYPE_MARKDOWN = "text/x-markdown; charset=utf-8".toMediaType()
      }
    }
    
    fun main() {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.6K bytes
    - Viewed (0)
  7. samples/guide/src/main/java/okhttp3/recipes/PostString.java

    import okhttp3.MediaType;
    import okhttp3.OkHttpClient;
    import okhttp3.Request;
    import okhttp3.RequestBody;
    import okhttp3.Response;
    
    public final class PostString {
      public static final MediaType MEDIA_TYPE_MARKDOWN
          = MediaType.get("text/x-markdown; charset=utf-8");
    
      private final OkHttpClient client = new OkHttpClient();
    
      public void run() throws Exception {
        String postBody = ""
            + "Releases\n"
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat May 25 18:02:55 GMT 2019
    - 1.7K bytes
    - Viewed (0)
  8. samples/guide/src/main/java/okhttp3/recipes/kt/PostMultipart.kt

            .setType(MultipartBody.FORM)
            .addFormDataPart("title", "Square Logo")
            .addFormDataPart(
              "image",
              "logo-square.png",
              File("docs/images/logo-square.png").asRequestBody(MEDIA_TYPE_PNG),
            )
            .build()
    
        val request =
          Request.Builder()
            .header("Authorization", "Client-ID $IMGUR_CLIENT_ID")
            .url("https://api.imgur.com/3/image")
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2.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 {
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jun 24 12:59:42 GMT 2019
    - 2.2K bytes
    - Viewed (0)
  10. mkdocs.yml

    theme:
      name: 'material'
      favicon: assets/images/icon-square.png
      logo: assets/images/icon-square.png
      palette:
        - media: "(prefers-color-scheme: light)"
          scheme: default
          primary: teal
          accent: blue
          toggle:
            icon: octicons/sun-24
            name: "Switch to Dark Mode"
        - media: "(prefers-color-scheme: dark)"
          scheme: slate
          primary: teal
          accent: blue
          toggle:
    Others
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Nov 20 15:26:12 GMT 2023
    - 3.8K bytes
    - Viewed (0)
Back to top