Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 59 for add_header (0.07 sec)

  1. mockwebserver/README.md

    ### Java
    ```java
    MockResponse response = new MockResponse.Builder()
        .addHeader("Content-Type", "application/json; charset=utf-8")
        .addHeader("Cache-Control", "no-cache")
        .body("{}")
        .build();
    ```
    
    ### Kotlin
    ```kotlin
    val response = MockResponse.Builder()
      .addHeader("Content-Type", "application/json; charset=utf-8")
      .addHeader("Cache-Control", "no-cache")
      .body("{}")
      .build()
    ```
    
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Thu Oct 30 21:39:59 UTC 2025
    - 8.1K bytes
    - Viewed (0)
  2. impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/mvnenc/EncryptContext.java

        public Map<String, Goal> goals;
    
        public List<AttributedString> header;
        public AttributedStyle style;
        public LineReader reader;
    
        public void addInHeader(String text) {
            addInHeader(AttributedStyle.DEFAULT, text);
        }
    
        public void addInHeader(AttributedStyle style, String text) {
            AttributedStringBuilder asb = new AttributedStringBuilder();
            asb.style(style).append(text);
    Registered: Sun Dec 28 03:35:09 UTC 2025
    - Last Modified: Wed Jun 11 13:14:09 UTC 2025
    - 2K bytes
    - Viewed (0)
  3. okhttp/src/jvmTest/kotlin/okhttp3/CallTest.kt

            .Builder()
            .code(503)
            .addHeader("Connection", "Close")
            .addHeader("Retry-After", "0")
            .body("You took too long!")
            .onResponseEnd(ShutdownConnection)
            .build(),
        )
        server.enqueue(
          MockResponse
            .Builder()
            .code(503)
            .addHeader("Connection", "Close")
            .addHeader("Retry-After", "0")
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Tue Nov 04 19:13:52 UTC 2025
    - 147.4K bytes
    - Viewed (0)
  4. mockwebserver/src/main/kotlin/mockwebserver3/MockResponse.kt

         * by a colon and a value.
         */
        public fun addHeader(header: String): Builder =
          apply {
            headers_.add(header)
          }
    
        /**
         * Adds a new header with the name and value. This may be used to add multiple headers with the
         * same name.
         */
        public fun addHeader(
          name: String,
          value: Any,
        ): Builder =
          apply {
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Fri Jun 20 11:46:46 UTC 2025
    - 17.8K bytes
    - Viewed (0)
  5. okhttp-sse/src/main/kotlin/okhttp3/sse/EventSources.kt

      fun createFactory(callFactory: Call.Factory): EventSource.Factory =
        EventSource.Factory { request, listener ->
          val actualRequest =
            if (request.header("Accept") == null) {
              request.newBuilder().addHeader("Accept", "text/event-stream").build()
            } else {
              request
            }
    
          RealEventSource(actualRequest, listener).apply {
            connect(callFactory)
          }
        }
    
      @JvmStatic
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Fri Oct 03 07:51:20 UTC 2025
    - 1.6K bytes
    - Viewed (0)
  6. okhttp/src/jvmTest/kotlin/okhttp3/ConnectionCoalescingTest.kt

          execute(differentDnsUrl)
        }
      }
    
      @Test
      fun skipsOnRedirectWhenDnsDontMatch() {
        server.enqueue(
          MockResponse
            .Builder()
            .code(301)
            .addHeader("Location", url.newBuilder().host("differentdns.com").build())
            .build(),
        )
        server.enqueue(
          MockResponse
            .Builder()
            .body("unexpected call")
            .build(),
        )
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Thu Jun 19 11:44:16 UTC 2025
    - 19.1K bytes
    - Viewed (0)
  7. okhttp-testing-support/src/main/kotlin/okhttp3/internal/RecordingOkAuthenticator.kt

        val header =
          when (response.code) {
            407 -> "Proxy-Authorization"
            else -> "Authorization"
          }
        return response.request
          .newBuilder()
          .addHeader(header, credential)
          .build()
      }
    
      private fun schemeMatches(response: Response): Boolean {
        if (scheme == null) return true
        return response.challenges().any { it.scheme.equals(scheme, ignoreCase = true) }
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Wed Mar 19 19:25:20 UTC 2025
    - 1.7K bytes
    - Viewed (0)
  8. impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/mvnup/UpgradeContext.java

        // Indentation control for nested logging
        private int indentLevel = 0;
        private String indentString = Indentation.DEFAULT;
    
        public void addInHeader(String text) {
            addInHeader(AttributedStyle.DEFAULT, text);
        }
    
        public void addInHeader(AttributedStyle style, String text) {
            AttributedStringBuilder asb = new AttributedStringBuilder();
            asb.style(style).append(text);
    Registered: Sun Dec 28 03:35:09 UTC 2025
    - Last Modified: Tue Nov 18 18:03:26 UTC 2025
    - 4.7K bytes
    - Viewed (0)
  9. okhttp/src/jvmTest/kotlin/okhttp3/DuplexTest.kt

        val body =
          MockSocketHandler()
            .sendResponse("ok")
            .exhaustResponse()
        server.enqueue(
          MockResponse
            .Builder()
            .clearHeaders()
            .addHeader("h1", "v1")
            .addHeader("h2", "v2")
            .trailers(headersOf("trailers", "boom"))
            .socketHandler(body)
            .build(),
        )
        val call =
          client.newCall(
            Request
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Tue Nov 04 19:13:52 UTC 2025
    - 25.8K bytes
    - Viewed (0)
  10. src/test/java/jcifs/http/NtlmHttpFilterTest.java

            filter.doFilter(request, response, filterChain);
    
            verify(response).setStatus(HttpServletResponse.SC_UNAUTHORIZED);
            verify(response).setHeader("WWW-Authenticate", "NTLM");
            verify(response).addHeader("WWW-Authenticate", "Basic realm=\"TestRealm\"");
            verify(filterChain, never()).doFilter(any(), any());
        }
    
        @Test
        void testDoFilter_alreadyAuthenticated_shouldProceed() throws Exception {
    Registered: Sat Dec 20 13:44:44 UTC 2025
    - Last Modified: Thu Aug 21 04:51:33 UTC 2025
    - 12.8K bytes
    - Viewed (0)
Back to top