Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for trimMargin (0.09 sec)

  1. okhttp-sse/src/test/java/okhttp3/sse/internal/EventSourceHttpTest.kt

        listener.assertExhausted()
      }
    
      @Test
      fun event() {
        server.enqueue(
          MockResponse.Builder()
            .body(
              """
              |data: hey
              |
              |
              """.trimMargin(),
            ).setHeader("content-type", "text/event-stream")
            .build(),
        )
        val source = newEventSource()
        assertThat(source.request().url.encodedPath).isEqualTo("/")
        listener.assertOpen()
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sun Jan 14 10:20:09 UTC 2024
    - 6.6K bytes
    - Viewed (0)
  2. okhttp-sse/src/test/java/okhttp3/sse/internal/ServerSentEventIteratorTest.kt

          |data: YHOO
          |data: +2
          |data: 10
          |
          |
          """.trimMargin(),
        )
        assertThat(callbacks.remove()).isEqualTo(Event(null, null, "YHOO\n+2\n10"))
      }
    
      @Test
      fun multilineCr() {
        consumeEvents(
          """
          |data: YHOO
          |data: +2
          |data: 10
          |
          |
          """.trimMargin().replace("\n", "\r"),
        )
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 6.4K bytes
    - Viewed (0)
  3. okhttp-sse/src/test/java/okhttp3/sse/internal/EventSourcesHttpTest.kt

      }
    
      @Test
      fun processResponse() {
        server.enqueue(
          MockResponse.Builder()
            .body(
              """
              |data: hey
              |
              |
              """.trimMargin(),
            ).setHeader("content-type", "text/event-stream")
            .build(),
        )
        val request =
          Request.Builder()
            .url(server.url("/"))
            .build()
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sun Jan 14 10:20:09 UTC 2024
    - 2.6K bytes
    - Viewed (0)
  4. okhttp-idna-mapping-table/src/main/kotlin/okhttp3/internal/idn/GenerateIdnaMappingTableCode.kt

            .addModifiers(KModifier.INTERNAL)
            .initializer(
              """
              |%T(⇥
              |sections = "%L",
              |ranges = "%L",
              |mappings = "%L",
              |⇤)
              """.trimMargin(),
              idnaMappingTable,
              data.sections.escapeDataString(),
              data.ranges.escapeDataString(),
              data.mappings.escapeDataString(),
            )
            .build(),
        )
        .build()
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 2.8K bytes
    - Viewed (0)
  5. samples/guide/src/main/java/okhttp3/recipes/kt/PostString.kt

      fun run() {
        val postBody =
          """
          |Releases
          |--------
          |
          | * _1.0_ May 6, 2013
          | * _1.1_ June 15, 2013
          | * _1.2_ August 11, 2013
          |
          """.trimMargin()
    
        val request =
          Request(
            url = "https://api.github.com/markdown/raw".toHttpUrl(),
            body = postBody.toRequestBody(MEDIA_TYPE_MARKDOWN),
          )
    
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 1.6K bytes
    - Viewed (0)
  6. okhttp/src/test/java/okhttp3/HeadersTest.kt

          """
          |content-length: 99
          |authorization: ██
          |proxy-authorization: ██
          |cookie: ██
          |set-cookie: ██
          |user-agent: OkHttp
          |
          """.trimMargin(),
        )
      }
    
      @Test fun headersAddAll() {
        val sourceHeaders =
          Headers.Builder()
            .add("A", "aa")
            .add("a", "aa")
            .add("B", "bb")
            .build()
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 8.6K bytes
    - Viewed (0)
  7. okhttp/src/main/kotlin/okhttp3/internal/-ResponseCommon.kt

          | * Response.networkResponse
          | * Response.priorResponse
          | * EventSourceListener
          | * WebSocketListener
          |(It is safe to call contentType() and contentLength() on these response bodies.)
          """.trimMargin(),
        )
      }
    
      override fun timeout() = Timeout.NONE
    
      override fun close() {
      }
    }
    
    fun Response.stripBody(): Response {
      return newBuilder()
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Apr 15 13:24:48 UTC 2024
    - 5.2K bytes
    - Viewed (0)
Back to top