Package com.jcabi.http

Examples of com.jcabi.http.Response.headers()


        final InputStream content
    ) throws IOException {
        final Response resp = this.origin
            .send(req, home, method, headers, content);
        final int remaining = Integer.parseInt(
            resp.headers().get("X-RateLimit-Remaining").get(0)
        );
        if (remaining < this.threshold) {
            final long reset = Long.parseLong(
                resp.headers().get("X-RateLimit-Reset").get(0)
            );
View Full Code Here


        final int remaining = Integer.parseInt(
            resp.headers().get("X-RateLimit-Remaining").get(0)
        );
        if (remaining < this.threshold) {
            final long reset = Long.parseLong(
                resp.headers().get("X-RateLimit-Reset").get(0)
            );
            final long now = TimeUnit.MILLISECONDS
                .toSeconds(System.currentTimeMillis());
            if (reset > now) {
                final long length = reset - now;
View Full Code Here

                        Base64.encodeBase64String("a:b".getBytes())
                    )
                ).uri().back().fetch().as(RestResponse.class)
                .assertStatus(HttpURLConnection.HTTP_OK);
            MatcherAssert.assertThat(
                resp.headers().get(HttpHeaders.LAST_MODIFIED).get(0),
                Matchers.is(DateUtils.formatDate(date))
            );
        } finally {
            facade.close();
        }
View Full Code Here

                        Base64.encodeBase64String("a:b".getBytes())
                    )
                ).uri().back().fetch().as(RestResponse.class)
                .assertStatus(HttpURLConnection.HTTP_OK);
            MatcherAssert.assertThat(
                Integer.parseInt(resp.headers().get("Age").get(0)),
                Matchers.greaterThanOrEqualTo(1)
            );
        } finally {
            facade.close();
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.