Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 10 of 10 for getContentAsString (0.08 seconds)

  1. src/test/java/org/codelibs/curl/CurlResponseTest.java

            response.setContentCache(cache);
    
            String content = response.getContentAsString();
    
            assertEquals(testContent, content);
        }
    
        @Test
        public void testGetContentAsStringWithoutCache() {
            CurlResponse response = new CurlResponse();
    
            try {
                response.getContentAsString();
                fail("Expected CurlException");
            } catch (CurlException e) {
    Created: Thu Apr 02 15:34:12 GMT 2026
    - Last Modified: Sat Mar 21 09:11:12 GMT 2026
    - 17.7K bytes
    - Click Count (0)
  2. src/main/java/org/codelibs/curl/CurlResponse.java

        /**
         * Gets the content of the response as a string.
         *
         * @return the content as a string.
         * @throws CurlException if an error occurs while accessing the content.
         */
        public String getContentAsString() {
            if (contentCache == null) {
                if (contentException != null) {
                    throw new CurlException("Failed to access the content.", contentException);
                }
    Created: Thu Apr 02 15:34:12 GMT 2026
    - Last Modified: Sat Mar 21 09:11:12 GMT 2026
    - 6.8K bytes
    - Click Count (0)
  3. src/test/java/org/codelibs/curl/io/IOIntegrationTest.java

            // ## Act ##
            try (CurlResponse response = req.execute()) {
                // ## Assert ##
                assertEquals(200, response.getHttpStatusCode());
                String content = response.getContentAsString();
                assertEquals("", content);
            }
        }
    
        @Test
        public void test_HeadRequestWith404_ReturnsEmptyBody() throws Exception {
            // ## Arrange ##
    Created: Thu Apr 02 15:34:12 GMT 2026
    - Last Modified: Sat Mar 21 12:00:34 GMT 2026
    - 44.1K bytes
    - Click Count (0)
  4. src/main/java/org/codelibs/fess/helper/CoordinatorHelper.java

                    .body(query)
                    .execute()) {
                if (response.getHttpStatusCode() == 200) {
                    final Map<String, Object> result = parseJson(response.getContentAsString());
                    final Map<String, Object> hits = getMapValue(result, "hits");
                    if (hits != null) {
                        final List<Map<String, Object>> hitList = getListValue(hits, "hits");
    Created: Tue Mar 31 13:07:34 GMT 2026
    - Last Modified: Sat Mar 28 06:59:19 GMT 2026
    - 33.3K bytes
    - Click Count (0)
  5. src/main/java/org/codelibs/fess/helper/NotificationHelper.java

                        }
                    } else {
                        logger.warn("Failed to send {} to {}. HTTP Status is {}. {}", body, url, response.getHttpStatusCode(),
                                response.getContentAsString());
                    }
                } catch (final IOException e) {
                    logger.warn("Failed to send {} to {}.", body, url, e);
                }
            }));
        }
    
        /**
    Created: Tue Mar 31 13:07:34 GMT 2026
    - Last Modified: Thu Jul 17 08:28:31 GMT 2025
    - 6.2K bytes
    - Click Count (0)
  6. README.md

                                    .header("Accept", "application/json")
                                    .execute()) {
        System.out.println("Status: " + response.getHttpStatusCode());
        System.out.println(response.getContentAsString());
    }
    ```
    
    ### Asynchronous request
    
    ```java
    import org.codelibs.curl.Curl;
    
    Curl.post("https://api.example.com/items")
        .body("{\"name\":\"item1\"}")
    Created: Thu Apr 02 15:34:12 GMT 2026
    - Last Modified: Thu Nov 20 13:34:13 GMT 2025
    - 2.5K bytes
    - Click Count (0)
  7. src/test/java/org/codelibs/curl/CurlTest.java

        @Test
        public void test_Get() {
            Curl.get("https://www.codelibs.org/").execute(response -> {
                final String content = response.getContentAsString();
                logger.info(content);
                assertTrue(content.length() > 0);
            }, e -> {
                logger.log(Level.SEVERE, "error", e);
                fail();
            });
        }
    
        @Test
    Created: Thu Apr 02 15:34:12 GMT 2026
    - Last Modified: Thu Nov 20 13:34:13 GMT 2025
    - 16.3K bytes
    - Click Count (0)
  8. src/main/java/org/codelibs/fess/app/web/admin/backup/AdminBackupAction.java

                    throw new IORuntimeException(e);
                }
            }).execute()) {
                if (logger.isDebugEnabled()) {
                    logger.debug("Bulk Response:\n{}", response.getContentAsString());
                }
                systemHelper.reloadConfiguration(resetJobs.get());
    
                if (logger.isInfoEnabled()) {
    Created: Tue Mar 31 13:07:34 GMT 2026
    - Last Modified: Mon Nov 24 02:07:40 GMT 2025
    - 32.1K bytes
    - Click Count (0)
  9. src/main/java/org/codelibs/fess/helper/PluginHelper.java

            if (logger.isDebugEnabled()) {
                logger.debug("Loading: url={}", url);
            }
            try (final CurlResponse response = createCurlRequest(url).execute()) {
                return response.getContentAsString();
            } catch (final IOException e) {
                throw new IORuntimeException(e);
            }
        }
    
        /**
         * Gets the list of installed artifacts of the specified type.
         *
    Created: Tue Mar 31 13:07:34 GMT 2026
    - Last Modified: Wed Mar 04 15:19:41 GMT 2026
    - 25.1K bytes
    - Click Count (0)
  10. src/main/java/org/codelibs/fess/opensearch/client/SearchEngineClient.java

                if (response.getHttpStatusCode() == 200) {
                    final String content = response.getContentAsString();
                    final ObjectMapper mapper = new ObjectMapper();
                    final List<Map<String, String>> aliases = mapper.readValue(content, new TypeReference<List<Map<String, String>>>() {
                    });
    Created: Tue Mar 31 13:07:34 GMT 2026
    - Last Modified: Thu Mar 26 14:36:23 GMT 2026
    - 138.6K bytes
    - Click Count (1)
Back to Top