- Sort Score
- Num 10 results
- Language All
Results 31 - 40 of 77 for MediaType (0.05 seconds)
-
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
Created: Fri Dec 26 11:42:13 GMT 2025 - Last Modified: Mon Jun 24 12:59:42 GMT 2019 - 2.2K bytes - Click Count (0) -
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: StringCreated: Fri Dec 26 11:42:13 GMT 2025 - Last Modified: Wed Mar 19 19:25:20 GMT 2025 - 10.9K bytes - Click Count (0) -
okhttp-testing-support/src/main/kotlin/okhttp3/ForwardingRequestBody.kt
import okio.BufferedSink open class ForwardingRequestBody( delegate: RequestBody?, ) : RequestBody() { private val delegate: RequestBody fun delegate(): RequestBody = delegate override fun contentType(): MediaType? = delegate.contentType() @Throws(IOException::class) override fun contentLength(): Long = delegate.contentLength() @Throws(IOException::class) override fun writeTo(sink: BufferedSink) {
Created: Fri Dec 26 11:42:13 GMT 2025 - Last Modified: Wed Mar 19 19:25:20 GMT 2025 - 1.3K bytes - Click Count (0) -
okhttp/src/jvmTest/kotlin/okhttp3/RequestTest.kt
"}}", ) } @Test fun gzip() { val mediaType = "text/plain; charset=utf-8".toMediaType() val originalBody = "This is the original message".toRequestBody(mediaType) assertThat(originalBody.contentLength()).isEqualTo(28L) assertThat(originalBody.contentType()).isEqualTo(mediaType) val request = Request .Builder() .url("https://square.com/")Created: Fri Dec 26 11:42:13 GMT 2025 - Last Modified: Fri Oct 24 11:36:14 GMT 2025 - 24.4K bytes - Click Count (0) -
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;
Created: Fri Dec 26 11:42:13 GMT 2025 - Last Modified: Sun Feb 27 15:23:43 GMT 2022 - 1.5K bytes - Click Count (0) -
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() {Created: Fri Dec 26 11:42:13 GMT 2025 - Last Modified: Mon Jan 08 01:13:22 GMT 2024 - 1.4K bytes - Click Count (0) -
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();
Created: Fri Dec 26 11:42:13 GMT 2025 - Last Modified: Wed Jun 04 17:43:43 GMT 2025 - 3.1K bytes - Click Count (0) -
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;
Created: Fri Dec 26 11:42:13 GMT 2025 - Last Modified: Sat Jan 12 03:31:36 GMT 2019 - 3.9K bytes - Click Count (0) -
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()
Created: Fri Dec 26 11:42:13 GMT 2025 - Last Modified: Fri Jun 20 11:46:46 GMT 2025 - 8.4K bytes - Click Count (0) -
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; }
Created: Fri Dec 26 11:42:13 GMT 2025 - Last Modified: Sat Aug 30 17:01:12 GMT 2025 - 47.8K bytes - Click Count (0)