Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 75 for MediaType (0.04 sec)

  1. okhttp/src/commonJvmAndroid/kotlin/okhttp3/MultipartBody.kt

     */
    @Suppress("NAME_SHADOWING")
    class MultipartBody internal constructor(
      private val boundaryByteString: ByteString,
      @get:JvmName("type") val type: MediaType,
      @get:JvmName("parts") val parts: List<Part>,
    ) : RequestBody() {
      private val contentType: MediaType = "$type; boundary=$boundary".toMediaType()
      private var contentLength = -1L
    
      @get:JvmName("boundary")
      val boundary: String
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Wed Mar 19 19:25:20 UTC 2025
    - 10.9K bytes
    - Viewed (0)
  2. 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: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Fri Apr 05 03:30:42 UTC 2024
    - 2K bytes
    - Viewed (0)
  3. okhttp-dnsoverhttps/api/okhttp-dnsoverhttps.api

    	public final fun url (Lokhttp3/HttpUrl;)Lokhttp3/dnsoverhttps/DnsOverHttps$Builder;
    }
    
    public final class okhttp3/dnsoverhttps/DnsOverHttps$Companion {
    	public final fun getDNS_MESSAGE ()Lokhttp3/MediaType;
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Sun Feb 27 15:23:43 UTC 2022
    - 1.5K bytes
    - Viewed (0)
  4. samples/guide/src/main/java/okhttp3/recipes/kt/PostFile.kt

     * limitations under the License.
     */
    package okhttp3.recipes.kt
    
    import java.io.File
    import java.io.IOException
    import okhttp3.HttpUrl.Companion.toHttpUrl
    import okhttp3.MediaType.Companion.toMediaType
    import okhttp3.OkHttpClient
    import okhttp3.Request
    import okhttp3.RequestBody.Companion.asRequestBody
    
    class PostFile {
      private val client = OkHttpClient()
    
      fun run() {
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 1.4K bytes
    - Viewed (0)
  5. 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: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Mon Jun 24 12:59:42 UTC 2019
    - 2.2K bytes
    - Viewed (0)
  6. 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: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Wed Jun 04 17:43:43 UTC 2025
    - 3.1K bytes
    - Viewed (0)
  7. okhttp/src/jvmTest/kotlin/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: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Fri Dec 27 13:39:56 UTC 2024
    - 1.1K bytes
    - Viewed (0)
  8. docs/recipes.md

    === ":material-language-java: Java"
        ```java
          public static final MediaType MEDIA_TYPE_MARKDOWN
              = MediaType.parse("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;
              }
    
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Sat Aug 30 17:01:12 UTC 2025
    - 47.8K bytes
    - Viewed (0)
  9. okhttp/src/jvmTest/kotlin/okhttp3/CallKotlinTest.kt

          override fun contentType(): MediaType = "application/xml".toMediaType()
    
          override fun writeTo(sink: BufferedSink) {
            sink.writeUtf8("<el")
            sink.flush()
            throw IOException("failed to stream the XML")
          }
        }
    
        class ValidRequestBody : RequestBody() {
          override fun contentType(): MediaType = "application/xml".toMediaType()
    
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Fri Jun 20 11:46:46 UTC 2025
    - 8.4K bytes
    - Viewed (0)
  10. samples/guide/src/main/java/okhttp3/recipes/Progress.java

     * See the License for the specific language governing permissions and
     * limitations under the License.
     */
    package okhttp3.recipes;
    
    import java.io.IOException;
    import okhttp3.MediaType;
    import okhttp3.OkHttpClient;
    import okhttp3.Request;
    import okhttp3.Response;
    import okhttp3.ResponseBody;
    import okio.Buffer;
    import okio.BufferedSource;
    import okio.ForwardingSource;
    import okio.Okio;
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Sat Jan 12 03:31:36 UTC 2019
    - 3.9K bytes
    - Viewed (0)
Back to top