Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 21 - 30 of 145 for Requestbodys (0.04 seconds)

The search processing time has exceeded the limit. The displayed results may be partial.

  1. samples/guide/src/main/java/okhttp3/recipes/kt/PostMultipart.kt

    import okhttp3.MultipartBody
    import okhttp3.OkHttpClient
    import okhttp3.Request
    import okhttp3.RequestBody.Companion.asRequestBody
    
    class PostMultipart {
      private val client = OkHttpClient()
    
      fun run() {
        // Use the imgur image upload API as documented at https://api.imgur.com/endpoints/image
        val requestBody =
          MultipartBody
            .Builder()
            .setType(MultipartBody.FORM)
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Wed Mar 19 19:25:20 GMT 2025
    - 2.1K bytes
    - Click Count (0)
  2. okhttp/src/commonJvmAndroid/kotlin/okhttp3/Request.kt

        open fun head(): Builder = method("HEAD", null)
    
        open fun post(body: RequestBody): Builder = method("POST", body)
    
        @JvmOverloads
        open fun delete(body: RequestBody? = RequestBody.EMPTY): Builder = method("DELETE", body)
    
        open fun put(body: RequestBody): Builder = method("PUT", body)
    
        open fun patch(body: RequestBody): Builder = method("PATCH", body)
    
        /**
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Thu Oct 30 13:46:58 GMT 2025
    - 14.7K bytes
    - Click Count (1)
  3. tests/test_modules_same_name_body/test_main.py

                                },
                            },
                        },
                        "summary": "Compute",
                        "operationId": "compute_a_compute_post",
                        "requestBody": {
                            "content": {
                                "application/json": {
                                    "schema": {
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Thu Feb 27 14:42:41 GMT 2025
    - 5.5K bytes
    - Click Count (0)
  4. okhttp/src/commonJvmAndroid/kotlin/okhttp3/MultipartBody.kt

          level = DeprecationLevel.ERROR,
        )
        fun body(): RequestBody = body
    
        companion object {
          @JvmStatic
          fun create(body: RequestBody): Part = create(null, body)
    
          @JvmStatic
          fun create(
            headers: Headers?,
            body: RequestBody,
          ): Part {
            require(headers?.get("Content-Type") == null) { "Unexpected header: Content-Type" }
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Wed Mar 19 19:25:20 GMT 2025
    - 10.9K bytes
    - Click Count (0)
  5. docs/recipes.md

              = 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;
              }
    
              @Override public void writeTo(BufferedSink sink) throws IOException {
    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)
  6. tests/test_request_body_parameters_media_type.py

    from fastapi.testclient import TestClient
    from pydantic import BaseModel
    
    app = FastAPI()
    
    media_type = "application/vnd.api+json"
    
    
    # NOTE: These are not valid JSON:API resources
    # but they are fine for testing requestBody with custom media_type
    class Product(BaseModel):
        name: str
        price: float
    
    
    class Shop(BaseModel):
        name: str
    
    
    @app.post("/products")
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 21:25:59 GMT 2025
    - 6.3K bytes
    - Click Count (0)
  7. okhttp/src/jvmTest/kotlin/okhttp3/ServerTruncatesRequestTest.kt

            .build(),
        )
    
        val requestBody = AsyncRequestBody()
    
        val call =
          client.newCall(
            Request(
              url = server.url("/"),
              body = requestBody,
            ),
          )
    
        call.execute().use { response ->
          assertThat(response.body.string()).isEqualTo("abc")
          val requestBodyOut = requestBody.takeSink()
          assertFailsWith<IOException> {
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Tue Nov 04 19:13:52 GMT 2025
    - 10.4K bytes
    - Click Count (0)
  8. okhttp/src/jvmTest/kotlin/okhttp3/MultipartBodyTest.kt

        body.writeTo(buffer)
        assertThat(body.contentLength()).isEqualTo(buffer.size)
        assertThat(buffer.readUtf8()).isEqualTo(expected)
      }
    
      fun String.toOneShotRequestBody(): RequestBody =
        object : RequestBody() {
          override fun contentType() = null
    
          override fun isOneShot(): Boolean = true
    
          override fun contentLength() = ******@****.***8Size()
    
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Wed Mar 19 19:25:20 GMT 2025
    - 10.5K bytes
    - Click Count (0)
  9. tests/test_tutorial/test_request_files/test_tutorial001_02.py

                "paths": {
                    "/files/": {
                        "post": {
                            "summary": "Create File",
                            "operationId": "create_file_files__post",
                            "requestBody": {
                                "content": {
                                    "multipart/form-data": {
                                        "schema": {
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Dec 27 18:19:10 GMT 2025
    - 7.4K bytes
    - Click Count (0)
  10. tests/test_sub_callbacks.py

                                    "name": "callback_url",
                                    "in": "query",
                                }
                            ],
                            "requestBody": {
                                "content": {
                                    "application/json": {
                                        "schema": {"$ref": "#/components/schemas/Invoice"}
                                    }
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Dec 27 18:19:10 GMT 2025
    - 12.9K bytes
    - Click Count (0)
Back to Top