Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 37 for Plain (0.28 sec)

  1. okhttp/src/test/java/okhttp3/MediaTypeTest.kt

        assertInvalid("te<t/plain", "No subtype found for: \"te<t/plain\"")
        assertInvalid(" text/plain", "No subtype found for: \" text/plain\"")
        assertInvalid("te xt/plain", "No subtype found for: \"te xt/plain\"")
        assertInvalid("text /plain", "No subtype found for: \"text /plain\"")
        assertInvalid("text/ plain", "No subtype found for: \"text/ plain\"")
        assertInvalid(
          "text/pl@in",
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 7.5K bytes
    - Viewed (0)
  2. 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 May 03 11:42:14 GMT 2024
    - Last Modified: Wed Jan 02 02:50:44 GMT 2019
    - 4.7K bytes
    - Viewed (0)
  3. samples/compare/src/test/kotlin/okhttp3/compare/ApacheHttpClientTest.kt

        request.addHeader("Accept", "text/plain")
    
        httpClient.execute(request).use { response ->
          assertThat(response.code).isEqualTo(200)
          assertThat(EntityUtils.toString(response.entity)).isEqualTo("hello, Apache HttpClient 5.x")
        }
    
        val recorded = server.takeRequest()
        assertThat(recorded.headers["Accept"]).isEqualTo("text/plain")
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2.1K bytes
    - Viewed (0)
  4. 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 May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 06 09:14:38 GMT 2024
    - 11.2K bytes
    - Viewed (1)
  5. samples/compare/src/test/kotlin/okhttp3/compare/JavaHttpClientTest.kt

            .header("Accept", "text/plain")
            .build()
    
        val response = httpClient.send(request, BodyHandlers.ofString())
        assertThat(response.statusCode()).isEqualTo(200)
        assertThat(response.body()).isEqualTo("hello, Java HTTP Client")
    
        val recorded = server.takeRequest()
        assertThat(recorded.headers["Accept"]).isEqualTo("text/plain")
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2.7K bytes
    - Viewed (0)
  6. okhttp/src/test/java/okhttp3/ResponseBodyTest.kt

        val body = text.toResponseBody()
        assertThat(body.string()).isEqualTo(text)
      }
    
      @Test
      fun unicodeTextWithCharset() {
        val text = "eile oli oliiviõli"
        val body = text.toResponseBody("text/plain; charset=UTF-8".toMediaType())
        assertThat(body.string()).isEqualTo(text)
      }
    
      @Test
      fun unicodeByteString() {
        val text = "eile oli oliiviõli"
        val body = text.toResponseBody()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4K bytes
    - Viewed (0)
  7. okhttp/src/test/java/okhttp3/RequestBodyTest.kt

          assertThat(requestBody.contentType()).isNull()
        }
      }
    
      @Test
      fun testFileDescriptorMediaType() {
        assertOnFileDescriptor { fd ->
          val contentType = "text/plain".toMediaType()
    
          val requestBody = fd.toRequestBody(contentType)
    
          assertThat(requestBody.contentType()).isEqualTo(contentType)
        }
      }
    
      @Test
      fun testFileDescriptorReadTwice() {
    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)
  8. okhttp/src/main/kotlin/okhttp3/MediaType.kt

      /**
       * Returns the high-level media type, such as "text", "image", "audio", "video", or "application".
       */
      @get:JvmName("type") val type: String,
      /**
       * Returns a specific media subtype, such as "plain" or "png", "mpeg", "mp4" or "xml".
       */
      @get:JvmName("subtype") val subtype: String,
      /** Alternating parameter names with their values, like `["charset", "utf-8"]`. */
      internal val parameterNamesAndValues: Array<String>,
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4.2K bytes
    - Viewed (0)
  9. okhttp/src/test/java/okhttp3/MediaTypeJvmTest.kt

        val mediaType = parse("text/plain; charset=\"!@#$%^&*()\"")
        assertNull(mediaType.charsetName())
      }
    
      @Test fun testUnsupportedCharset() {
        val mediaType = parse("text/plain; charset=utf-wtf")
        assertNull(mediaType.charsetName())
      }
    
      @Test fun testCharsetNameIsDoubleQuotedAndSingleQuoted() {
        val mediaType = parse("text/plain;charset=\"'utf-8'\"")
        assertNull(mediaType.charsetName())
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3K bytes
    - Viewed (0)
  10. okhttp-logging-interceptor/src/test/java/okhttp3/logging/HttpLoggingInterceptorTest.kt

                .header("Content-Type", "text/plain-ish")
                .build(),
            )
          }
        server.enqueue(MockResponse())
        client.newCall(
          request()
            .post("Hi?".toRequestBody(PLAIN))
            .build(),
        ).execute()
        applicationLogs
          .assertLogEqual("--> POST $url")
          .assertLogEqual("Content-Type: text/plain; charset=utf-8")
          .assertLogEqual("Content-Length: 3")
    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