Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 24 for setBody (0.14 sec)

  1. mockwebserver-deprecated/src/main/kotlin/okhttp3/mockwebserver/MockResponse.kt

        apply {
          headersBuilder.removeAll(name)
        }
    
      fun getBody(): Buffer? = body?.clone()
    
      fun setBody(body: Buffer) =
        apply {
          setHeader("Content-Length", body.size)
          this.body = body.clone() // Defensive copy.
        }
    
      fun setBody(body: String): MockResponse = setBody(Buffer().writeUtf8(body))
    
      fun setChunkedBody(
        body: Buffer,
        maxChunkSize: Int,
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 7.2K bytes
    - Viewed (0)
  2. fess-crawler/src/test/java/org/codelibs/fess/crawler/entity/TestEntity.java

        }
    
        public String getTitle() {
            return title;
        }
    
        public void setTitle(final String title) {
            this.title = title;
        }
    
        public String getBody() {
            return body;
        }
    
        public void setBody(final String body) {
            this.body = body;
        }
    Registered: Sun Nov 10 03:50:12 UTC 2024
    - Last Modified: Thu Feb 22 01:36:27 UTC 2024
    - 1.2K bytes
    - Viewed (0)
  3. mockwebserver/README.md

      // instance for every unit test.
      MockWebServer server = new MockWebServer();
    
      // Schedule some responses.
      server.enqueue(new MockResponse().setBody("hello, world!"));
      server.enqueue(new MockResponse().setBody("sup, bra?"));
      server.enqueue(new MockResponse().setBody("yo dog"));
    
      // Start the server.
      server.start();
    
      // Ask the server for its URL. You'll need this to make HTTP requests.
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sun Dec 17 15:34:10 UTC 2023
    - 5K bytes
    - Viewed (0)
  4. mockwebserver-deprecated/src/test/java/okhttp3/mockwebserver/MockWebServerTest.kt

        server.enqueue(
          MockResponse()
            .setResponseCode(HttpURLConnection.HTTP_MOVED_TEMP)
            .addHeader("Location: " + server.url("/new-path"))
            .setBody("This page has moved!"),
        )
        server.enqueue(MockResponse().setBody("This is the new location!"))
        val connection = server.url("/").toUrl().openConnection()
        val inputStream = connection.getInputStream()
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 21.9K bytes
    - Viewed (0)
  5. mockwebserver-deprecated/src/test/java/okhttp3/mockwebserver/KotlinSourceModernTest.kt

        mockResponse.headers = headersOf()
        mockResponse.trailers = headersOf()
        mockResponse = mockResponse.removeHeader("")
        var body: Buffer? = mockResponse.getBody()
        mockResponse = mockResponse.setBody(Buffer())
        mockResponse = mockResponse.setChunkedBody(Buffer(), 0)
        mockResponse = mockResponse.setChunkedBody("", 0)
        var socketPolicy: SocketPolicy = mockResponse.socketPolicy
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 7.3K bytes
    - Viewed (0)
  6. okhttp/src/test/java/okhttp3/CacheTest.kt

      }
    
      internal enum class TransferKind {
        CHUNKED {
          override fun setBody(
            response: MockResponse.Builder,
            content: Buffer,
            chunkSize: Int,
          ) {
            response.chunkedBody(content, chunkSize)
          }
        },
        FIXED_LENGTH {
          override fun setBody(
            response: MockResponse.Builder,
            content: Buffer,
            chunkSize: Int,
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Wed Apr 10 19:46:48 UTC 2024
    - 108.6K bytes
    - Viewed (0)
  7. mockwebserver-deprecated/api/mockwebserver.api

    	public final fun headers (Lokhttp3/Headers;)V
    	public final fun http2ErrorCode (I)V
    	public final fun removeHeader (Ljava/lang/String;)Lokhttp3/mockwebserver/MockResponse;
    	public final fun setBody (Ljava/lang/String;)Lokhttp3/mockwebserver/MockResponse;
    	public final fun setBody (Lokio/Buffer;)Lokhttp3/mockwebserver/MockResponse;
    	public final fun setBodyDelay (JLjava/util/concurrent/TimeUnit;)Lokhttp3/mockwebserver/MockResponse;
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sat Jul 22 12:28:51 UTC 2023
    - 10.2K bytes
    - Viewed (0)
  8. okhttp/src/test/java/okhttp3/internal/http/ThreadInterruptTest.kt

          call.execute()
        }
      }
    
      @Test
      fun interruptReadingResponseBody() {
        val responseBodySize = 8 * 1024 * 1024 // 8 MiB.
        server.enqueue(
          MockResponse()
            .setBody(Buffer().write(ByteArray(responseBodySize)))
            .throttleBody((64 * 1024).toLong(), 125, TimeUnit.MILLISECONDS),
        ) // 500 Kbps
        server.start()
        val call =
          client.newCall(
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 4.6K bytes
    - Viewed (0)
  9. okhttp/src/test/java/okhttp3/URLConnectionTest.kt

          }
        }, ;
    
        abstract fun setBody(
          response: MockResponse.Builder,
          content: Buffer?,
          chunkSize: Int,
        )
    
        abstract fun newRequestBody(body: String): RequestBody
    
        fun setBody(
          response: MockResponse.Builder,
          content: String?,
          chunkSize: Int,
        ) {
          setBody(response, Buffer().writeUtf8(content!!), chunkSize)
        }
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sat Jan 20 10:30:28 UTC 2024
    - 131.7K bytes
    - Viewed (0)
  10. mockwebserver/api/mockwebserver3.api

    	public final fun inTunnel ()Lmockwebserver3/MockResponse$Builder;
    	public final fun removeHeader (Ljava/lang/String;)Lmockwebserver3/MockResponse$Builder;
    	public final fun setBody (Lmockwebserver3/MockResponseBody;)V
    	public final fun setCode (I)V
    	public final fun setHeader (Ljava/lang/String;Ljava/lang/Object;)Lmockwebserver3/MockResponse$Builder;
    	public final fun setSocketPolicy (Lmockwebserver3/SocketPolicy;)V
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Tue Jan 03 21:59:45 UTC 2023
    - 12.7K bytes
    - Viewed (0)
Back to top