Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 124 for Content (0.21 sec)

  1. okhttp-logging-interceptor/src/main/kotlin/okhttp3/logging/HttpLoggingInterceptor.kt

           *
           * Example:
           * ```
           * --> POST /greeting http/1.1
           * Host: example.com
           * Content-Type: plain/text
           * Content-Length: 3
           * --> END POST
           *
           * <-- 200 OK (22ms)
           * Content-Type: plain/text
           * Content-Length: 6
           * <-- END HTTP
           * ```
           */
          HEADERS,
    
          /**
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Apr 06 09:14:38 GMT 2024
    - 11.2K bytes
    - Viewed (1)
  2. okhttp/src/test/java/okhttp3/RequestBodyTest.kt

          FileInputStream(filePath.toFile()).use { fis ->
            fn(fis.fd)
          }
        }
      }
    
      private inline fun <T> assertOnPath(
        content: String? = null,
        fn: (okio.Path) -> T,
      ): T {
        FileSystem.SYSTEM.write(filePath) {
          if (content != null) {
            writeUtf8(content)
          }
        }
    
        return fn(filePath)
      }
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.6K bytes
    - Viewed (1)
  3. samples/static-server/src/main/java/okhttp3/sample/SampleServer.java

          return new MockResponse()
              .setStatus("HTTP/1.1 404")
              .addHeader("content-type: text/plain; charset=utf-8")
              .setBody("NOT FOUND: " + path);
        } catch (IOException e) {
          return new MockResponse()
              .setStatus("HTTP/1.1 500")
              .addHeader("content-type: text/plain; charset=utf-8")
              .setBody("SERVER ERROR: " + e);
        }
      }
    
    Java
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Wed Jan 02 02:50:44 GMT 2019
    - 4.7K bytes
    - Viewed (0)
  4. okhttp/src/test/java/okhttp3/URLConnectionTest.kt

       * content to go along with it. https://github.com/square/okhttp/issues/358
       */
      @Test
      fun noTransparentGzipFor304NotModified() {
        server.enqueue(
          MockResponse.Builder()
            .clearHeaders()
            .code(HttpURLConnection.HTTP_NOT_MODIFIED)
            .addHeader("Content-Encoding: gzip")
            .build(),
        )
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 131.7K bytes
    - Viewed (0)
  5. okhttp/src/main/kotlin/okhttp3/internal/http/RealResponseBody.kt

    import okhttp3.MediaType.Companion.toMediaTypeOrNull
    import okhttp3.ResponseBody
    import okio.BufferedSource
    
    class RealResponseBody(
      /**
       * Use a string to avoid parsing the content type until needed. This also defers problems caused
       * by malformed content types.
       */
      private val contentTypeString: String?,
      private val contentLength: Long,
      private val source: BufferedSource,
    ) : ResponseBody() {
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.2K bytes
    - Viewed (0)
  6. okhttp/src/test/java/okhttp3/ResponseBodyJvmTest.kt

              return Buffer().writeUtf8("hello")
            }
          }
        assertFailsWith<IOException> {
          body.bytes()
        }.also { expected ->
          assertThat(expected.message).isEqualTo(
            "Content-Length (10) and stream length (5) disagree",
          )
        }
      }
    
      @Test
      fun bytesThrowsMoreThanIntMaxValue() {
        val body: ResponseBody =
          object : ResponseBody() {
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 13K bytes
    - Viewed (0)
  7. mockwebserver/README.md

    You can set a custom body with a string, input stream or byte array. Also
    add headers with a fluent builder API.
    
    ```java
    MockResponse response = new MockResponse()
        .addHeader("Content-Type", "application/json; charset=utf-8")
        .addHeader("Cache-Control", "no-cache")
        .setBody("{}");
    ```
    
    MockResponse can be used to simulate a slow network. This is useful for
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sun Dec 17 15:34:10 GMT 2023
    - 5K bytes
    - Viewed (1)
  8. samples/compare/src/test/kotlin/okhttp3/compare/JavaHttpClientTest.kt

        assertThat(recorded.headers["Connection"]).isEqualTo("Upgrade, HTTP2-Settings")
        if (PlatformVersion.majorVersion < 19) {
          assertThat(recorded.headers["Content-Length"]).isEqualTo("0")
        }
        assertThat(recorded.headers["HTTP2-Settings"]).isNotNull()
        assertThat(recorded.headers["Upgrade"]).isEqualTo("h2c") // HTTP/2 over plaintext!
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2.7K bytes
    - Viewed (0)
  9. docs/changelogs/changelog_4x.md

     *  Fix: Un-deprecate `MockResponse.setHeaders()` and other setters. These were deprecated in OkHttp
        4.0 but that broke method chaining for Java callers.
    
     *  Fix: Don't crash on HTTP/2 HEAD requests when the `Content-Length` header is present but is not
        consistent with the length of the response body.
    
     *  Fix: Don't crash when converting a `HttpUrl` instance with an unresolvable hostname to a URI.
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Wed Apr 17 13:25:31 GMT 2024
    - 25.2K bytes
    - Viewed (0)
  10. android-test-app/src/main/AndroidManifest.xml

        android:name=".TestApplication"
      >
        <activity
          android:name=".MainActivity"
          android:exported="true">
          <intent-filter>
            <action android:name="android.intent.action.MAIN" />
    
            <category android:name="android.intent.category.LAUNCHER" />
          </intent-filter>
        </activity>
      </application>
    
    XML
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Dec 23 14:46:51 GMT 2023
    - 683 bytes
    - Viewed (0)
Back to top