Package com.jcabi.http.response

Examples of com.jcabi.http.response.JsonResponse


     * Main entry point.
     * @param args Command line arguments
     */
    public static void main(final String[] args) throws Exception {
        final Github github = new RtGithub();
        final JsonResponse resp = github.entry()
            .uri().path("/search/repositories")
            .queryParam("q", "java").back()
            .fetch()
            .as(JsonResponse.class);
        final List<JsonObject> items = resp.json().readObject()
            .getJsonArray("items")
            .getValuesAs(JsonObject.class);
        for (final JsonObject item : items) {
            System.out.println(
                String.format(
View Full Code Here


     */
    @Test
    public void readNonUnicode() throws Exception {
        final Response resp = new FakeRequest()
            .withBody("{\"help\": \"\u001Fblah\u0001cwhoa\u0000!\"}").fetch();
        final JsonResponse response = new JsonResponse(resp);
        MatcherAssert.assertThat(
            response.json().readObject().getString("help"),
            Matchers.is("\u001Fblah\u0001cwhoa\u0000!")
        );
    }
View Full Code Here

TOP

Related Classes of com.jcabi.http.response.JsonResponse

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.