Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 55 for requestBody (0.21 sec)

  1. okhttp/src/main/kotlin/okhttp3/RequestBody.kt

          offset: Int = 0,
          byteCount: Int = size,
        ): RequestBody = commonToRequestBody(contentType, offset, byteCount)
    
        /** Returns a new request body that transmits the content of this. */
        @JvmStatic
        @JvmName("create")
        fun File.asRequestBody(contentType: MediaType? = null): RequestBody {
          return object : RequestBody() {
            override fun contentType() = contentType
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Jan 25 14:41:37 GMT 2024
    - 9.6K bytes
    - Viewed (0)
  2. okhttp/src/test/java/okhttp3/RequestBodyTest.kt

        assertOnFileDescriptor { fd ->
          val requestBody = fd.toRequestBody()
    
          assertThat(requestBody.contentLength()).isEqualTo(-1L)
          assertThat(requestBody.isOneShot()).isEqualTo(true)
        }
      }
    
      @Test
      fun testFileDescriptorRead() {
        assertOnFileDescriptor(content = "Hello") { fd ->
          val requestBody = fd.toRequestBody()
    
          val buffer = Buffer()
          requestBody.writeTo(buffer)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.6K bytes
    - Viewed (1)
  3. okhttp-logging-interceptor/src/main/kotlin/okhttp3/logging/HttpLoggingInterceptor.kt

          val requestBody = request.body
    
          val connection = chain.connection()
          var requestStartMessage =
            ("--> ${request.method} ${redactUrl(request.url)}${if (connection != null) " " + connection.protocol() else ""}")
          if (!logHeaders && requestBody != null) {
            requestStartMessage += " (${requestBody.contentLength()}-byte body)"
          }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 06 09:14:38 GMT 2024
    - 11.2K bytes
    - Viewed (1)
  4. okhttp/src/test/java/okhttp3/ServerTruncatesRequestTest.kt

          ),
        )
    
        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> {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 9.5K bytes
    - Viewed (0)
  5. okhttp/src/test/java/okhttp3/URLConnectionTest.kt

          getResponse(
            Request(
              url = server.url("/b"),
              body = requestBody,
            ),
          )
        }
      }
    
      @Test
      fun fullyBufferedPostIsTooLong() {
        server.enqueue(
          MockResponse(body = "A"),
        )
        val requestBody: RequestBody =
          object : RequestBody() {
            override fun contentType(): MediaType? = null
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 131.7K bytes
    - Viewed (0)
  6. okhttp/src/main/kotlin/okhttp3/internal/-RequestCommon.kt

    fun Request.Builder.commonPost(body: RequestBody): Request.Builder = method("POST", body)
    
    fun Request.Builder.commonDelete(body: RequestBody?): Request.Builder = method("DELETE", body)
    
    fun Request.Builder.commonPut(body: RequestBody): Request.Builder = method("PUT", body)
    
    fun Request.Builder.commonPatch(body: RequestBody): Request.Builder = method("PATCH", body)
    
    fun Request.Builder.commonMethod(
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4.1K bytes
    - Viewed (0)
  7. okhttp/src/test/java/okhttp3/DuplexTest.kt

          )
        call.execute().use { response ->
          val requestBody = (call.request().body as AsyncRequestBody?)!!.takeSink()
          requestBody.writeUtf8("request A\n")
          requestBody.flush()
          val responseBody = response.body.source()
          assertThat(responseBody.readUtf8Line())
            .isEqualTo("response B")
          requestBody.writeUtf8("request C\n")
          requestBody.flush()
          assertThat(responseBody.readUtf8Line())
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 23.9K bytes
    - Viewed (0)
  8. okhttp/src/test/java/okhttp3/CallTest.kt

          Request.Builder()
            .url(server.url("/"))
            .method("POST", requestBody1)
            .build()
        val response1 = client.newCall(request1).execute()
        assertThat(response1.code).isEqualTo(200)
    
        // Call 2: check for the absence of a deadline on the request body.
        val requestBody2: RequestBody =
          object : RequestBody() {
            override fun contentType(): MediaType = "text/plain".toMediaType()
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Apr 10 19:46:48 GMT 2024
    - 142.5K bytes
    - Viewed (0)
  9. okhttp/src/main/kotlin/okhttp3/internal/http/CallServerInterceptor.kt

        val request = realChain.request
        val requestBody = request.body
        val sentRequestMillis = System.currentTimeMillis()
    
        var invokeStartEvent = true
        var responseBuilder: Response.Builder? = null
        var sendRequestException: IOException? = null
        try {
          exchange.writeRequestHeaders(request)
    
          if (HttpMethod.permitsRequestBody(request.method) && requestBody != null) {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 6.3K bytes
    - Viewed (1)
  10. okhttp-logging-interceptor/src/test/java/okhttp3/logging/HttpLoggingInterceptorTest.kt

    import okhttp3.MediaType.Companion.toMediaType
    import okhttp3.OkHttpClient
    import okhttp3.Protocol
    import okhttp3.RecordingHostnameVerifier
    import okhttp3.Request
    import okhttp3.RequestBody
    import okhttp3.RequestBody.Companion.gzip
    import okhttp3.RequestBody.Companion.toRequestBody
    import okhttp3.logging.HttpLoggingInterceptor.Level
    import okhttp3.testing.PlatformRule
    import okio.Buffer
    import okio.BufferedSink
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 06 09:14:38 GMT 2024
    - 37.6K bytes
    - Viewed (0)
Back to top