Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 54 for addHeader (0.06 sec)

  1. src/test/java/org/codelibs/fess/helper/UserAgentHelperTest.java

        }
    
        public void test_getUserAgentType_IE9() {
            getMockRequest().addHeader("user-agent", "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0; Trident/5.0)");
            assertEquals(UserAgentType.IE, userAgentHelper.getUserAgentType());
        }
    
        public void test_getUserAgentType_IE10() {
            getMockRequest().addHeader("user-agent", "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)");
    Registered: 2024-10-31 13:40
    - Last Modified: 2024-02-22 01:37
    - 3K bytes
    - Viewed (0)
  2. okhttp/src/test/java/okhttp3/CacheTest.kt

          MockResponse.Builder()
            .addHeader("Etag", "a")
            .addHeader("Cache-Control: max-age=0")
            .addHeader("A: a1")
            .addHeader("B: b2")
            .addHeader("B: b3")
            .body("abcd")
            .build(),
        )
        server.enqueue(
          MockResponse.Builder()
            .code(HttpURLConnection.HTTP_NOT_MODIFIED)
            .addHeader("B: b4")
            .addHeader("B: b5")
    Registered: 2024-11-01 11:42
    - Last Modified: 2024-04-10 19:46
    - 108.6K bytes
    - Viewed (0)
  3. okhttp/src/test/java/okhttp3/CookiesTest.kt

      }
    
      @Test
      fun receiveAndSendMultipleCookies() {
        server.enqueue(
          MockResponse.Builder()
            .addHeader("Set-Cookie", "a=android")
            .addHeader("Set-Cookie", "b=banana")
            .build(),
        )
        server.enqueue(MockResponse())
        val cookieManager = CookieManager(null, CookiePolicy.ACCEPT_ORIGINAL_SERVER)
        client =
    Registered: 2024-11-01 11:42
    - Last Modified: 2024-01-08 01:13
    - 13K bytes
    - Viewed (0)
  4. src/test/java/org/codelibs/fess/helper/AccessTokenHelperTest.java

            req.addHeader("Authorization", "Bearer " + token);
            assertEquals(token, accessTokenHelper.getAccessTokenFromRequest(req));
        }
    
        public void test_getAccessTokenFromRequest_ok1() {
            final String token = accessTokenHelper.generateAccessToken();
            MockletHttpServletRequest req = getMockRequest();
            req.addHeader("Authorization", token);
    Registered: 2024-10-31 13:40
    - Last Modified: 2024-02-22 01:37
    - 3.1K bytes
    - Viewed (0)
  5. samples/static-server/src/main/java/okhttp3/sample/SampleServer.java

        } catch (FileNotFoundException e) {
          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);
        }
      }
    
    Registered: 2024-11-01 11:42
    - Last Modified: 2019-01-02 02:50
    - 4.7K bytes
    - Viewed (0)
  6. src/main/java/org/codelibs/fess/cors/DefaultCorsHandler.java

            httpResponse.addHeader(ACCESS_CONTROL_ALLOW_ORIGIN, origin);
            httpResponse.addHeader(ACCESS_CONTROL_ALLOW_METHODS, fessConfig.getApiCorsAllowMethods());
            httpResponse.addHeader(ACCESS_CONTROL_ALLOW_HEADERS, fessConfig.getApiCorsAllowHeaders());
            httpResponse.addHeader(ACCESS_CONTROL_MAX_AGE, fessConfig.getApiCorsMaxAge());
    Registered: 2024-10-31 13:40
    - Last Modified: 2024-02-22 01:53
    - 2K bytes
    - Viewed (0)
  7. src/test/java/org/codelibs/fess/helper/RoleQueryHelperTest.java

            }
    
            roleQueryHelperImpl.headerKey = "fess1";
    
            getMockRequest().addHeader("aaa", "bbb");
            roleSet = buildByHeader(roleQueryHelperImpl, getMockRequest());
            assertEquals(0, roleSet.size());
    
            roleQueryHelperImpl.encryptedHeaderValue = false;
            getMockRequest().addHeader("fess1", System.currentTimeMillis() / 1000 + "\nrole1,role2,role3");
    Registered: 2024-10-31 13:40
    - Last Modified: 2024-02-22 01:53
    - 14.2K bytes
    - Viewed (0)
  8. mockwebserver-deprecated/src/main/kotlin/okhttp3/mockwebserver/MockResponse.kt

        return apply { status = "HTTP/1.1 $code $reason" }
      }
    
      fun clearHeaders() =
        apply {
          headersBuilder = Headers.Builder()
        }
    
      fun addHeader(header: String) =
        apply {
          headersBuilder.add(header)
        }
    
      fun addHeader(
        name: String,
        value: Any,
      ) = apply {
        headersBuilder.add(name, value.toString())
      }
    
      fun addHeaderLenient(
        name: String,
    Registered: 2024-11-01 11:42
    - Last Modified: 2024-01-08 01:13
    - 7.2K bytes
    - Viewed (0)
  9. okhttp/src/test/java/okhttp3/RequestCommonTest.kt

        builder.header("AZab09~", "AZab09 ~")
        builder.addHeader("AZab09~", "AZab09 ~")
      }
    
      @Test
      fun emptyNameForbidden() {
        val builder = Request.Builder()
        assertFailsWith<IllegalArgumentException> {
          builder.header("", "Value")
        }
        assertFailsWith<IllegalArgumentException> {
          builder.addHeader("", "Value")
        }
      }
    
      @Test
    Registered: 2024-11-01 11:42
    - Last Modified: 2024-01-08 01:13
    - 10.7K bytes
    - Viewed (0)
  10. samples/guide/src/main/java/okhttp3/recipes/kt/AccessHeaders.kt

      fun run() {
        val request =
          Request.Builder()
            .url("https://api.github.com/repos/square/okhttp/issues")
            .header("User-Agent", "OkHttp Headers.java")
            .addHeader("Accept", "application/json; q=0.5")
            .addHeader("Accept", "application/vnd.github.v3+json")
            .build()
    
        client.newCall(request).execute().use { response ->
          if (!response.isSuccessful) throw IOException("Unexpected code $response")
    Registered: 2024-11-01 11:42
    - Last Modified: 2024-01-08 01:13
    - 1.4K bytes
    - Viewed (0)
Back to top