Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 26 for Amelia (0.17 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. docs/changelogs/changelog_4x.md

            val part = multipartReader.nextPart() ?: break
            process(part.headers, part.body)
          }
        }
        ```
    
     *  New: `MediaType.parameter()` gets a parameter like `boundary` from a media type like
        `multipart/mixed; boundary="abc"`.
    
     *  New: `Authenticator.JAVA_NET_AUTHENTICATOR` forwards authentication requests to
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Apr 17 13:25:31 GMT 2024
    - 25.2K bytes
    - Viewed (0)
  4. okhttp/src/main/kotlin/okhttp3/internal/-MediaTypeCommon.kt

    private const val QUOTED = "\"([^\"]*)\""
    private val TYPE_SUBTYPE = Regex("$TOKEN/$TOKEN")
    private val PARAMETER = Regex(";\\s*(?:$TOKEN=(?:$TOKEN|$QUOTED))?")
    
    /**
     * Returns a media type for this string.
     *
     * @throws IllegalArgumentException if this is not a well-formed media type.
     */
    internal fun String.commonToMediaType(): MediaType {
      val typeSubtype: MatchResult =
        TYPE_SUBTYPE.matchAtPolyfill(this, 0)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.1K bytes
    - Viewed (0)
  5. samples/guide/src/main/java/okhttp3/recipes/kt/PostPath.kt

      fun run() {
        fileSystem.write(path) {
          writeUtf8("{}")
        }
    
        val request =
          Request.Builder()
            .url("https://httpbin.org/anything")
            .put(path.asRequestBody(fileSystem, MEDIA_TYPE_JSON))
            .build()
    
        client.newCall(request).execute().use { response ->
          if (!response.isSuccessful) throw IOException("Unexpected code $response")
    
          fileSystem.sink(path).use {
    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)
  6. samples/guide/src/main/java/okhttp3/recipes/PostStreamingWithPipe.java

    import okhttp3.Request;
    import okhttp3.RequestBody;
    import okhttp3.Response;
    import okio.BufferedSink;
    import okio.Okio;
    import okio.Pipe;
    
    public final class PostStreamingWithPipe {
      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 {
        final PipeBody pipeBody = new PipeBody();
    
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Fri Jul 06 03:18:15 GMT 2018
    - 3.1K 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();
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat May 25 18:02:55 GMT 2019
    - 3.8K bytes
    - Viewed (0)
  8. 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)
  9. 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)
  10. 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)
Back to top