Package com.jcabi.http.response

Examples of com.jcabi.http.response.XmlResponse


            .assertStatus(HttpURLConnection.HTTP_SEE_OTHER);
    }

    @Override
    public Counter get(final String name) throws IOException {
        final XmlResponse rsp = this.request.fetch()
            .as(RestResponse.class)
            .assertStatus(HttpURLConnection.HTTP_OK)
            .as(XmlResponse.class);
        return new RtCounter(
            name,
            rsp.rel(
                String.format(
                    // @checkstyle LineLength (1 line)
                    "/page/counters/counter[name='%s']/links/link[@rel='set']/@href",
                    name
                )
            ),
            rsp.rel(
                String.format(
                    // @checkstyle LineLength (1 line)
                    "/page/counters/counter[name='%s']/links/link[@rel='increment']/@href",
                    name
                )
View Full Code Here


     * @param req Request
     * @param name Name of the lock
     * @throws IOException If fails
     */
    RtLock(final Request req, final String name) throws IOException {
        final XmlResponse rsp = req.fetch()
            .as(RestResponse.class)
            .assertStatus(HttpURLConnection.HTTP_OK)
            .as(XmlResponse.class);
        this.lrequest = rsp.rel("/page/links/link[@rel='lock']/@href")
            .method(Request.POST)
            .body().formParam("name", name).back();
        this.urequest = rsp.rel("/page/links/link[@rel='unlock']/@href")
            .method(Request.GET)
            .uri().queryParam("name", name).back();
    }
View Full Code Here

            .assertStatus(HttpURLConnection.HTTP_SEE_OTHER);
    }

    @Override
    public Counter get(final String name) throws IOException {
        final XmlResponse rsp = this.request.fetch()
            .as(RestResponse.class)
            .assertStatus(HttpURLConnection.HTTP_OK)
            .as(XmlResponse.class);
        return new RtCounter(
            rsp.rel(
                String.format(
                    // @checkstyle LineLength (1 line)
                    "/page/counters/counter[name='%s']/links/link[@rel='set']/@href",
                    name
                )
            ),
            rsp.rel(
                String.format(
                    // @checkstyle LineLength (1 line)
                    "/page/counters/counter[name='%s']/links/link[@rel='increment']/@href",
                    name
                )
View Full Code Here

        );
    }

    @Override
    public Counter get(final String name) throws IOException {
        final XmlResponse rsp = this.request.fetch()
            .as(RestResponse.class)
            .assertStatus(HttpURLConnection.HTTP_OK)
            .as(XmlResponse.class);
        return new RtCounter(
            name,
            rsp.rel(
                String.format(
                    // @checkstyle LineLength (1 line)
                    "/page/counters/counter[name='%s']/links/link[@rel='set']/@href",
                    name
                )
            ),
            rsp.rel(
                String.format(
                    // @checkstyle LineLength (1 line)
                    "/page/counters/counter[name='%s']/links/link[@rel='increment']/@href",
                    name
                )
View Full Code Here

            .assertStatus(HttpURLConnection.HTTP_SEE_OTHER);
    }

    @Override
    public Counter get(final String name) throws IOException {
        final XmlResponse rsp = this.request.fetch()
            .as(RestResponse.class)
            .assertStatus(HttpURLConnection.HTTP_OK)
            .as(XmlResponse.class);
        return new RtCounter(
            rsp.rel(
                String.format(
                    // @checkstyle LineLength (1 line)
                    "/page/counters/counter[name='%s']/links/link[@rel='set']/@href",
                    name
                )
            ),
            rsp.rel(
                String.format(
                    // @checkstyle LineLength (1 line)
                    "/page/counters/counter[name='%s']/links/link[@rel='increment']/@href",
                    name
                )
View Full Code Here

     * @param req Request
     * @param name Name of the lock
     * @throws IOException If fails
     */
    RtLock(final Request req, final String name) throws IOException {
        final XmlResponse rsp = req.fetch()
            .as(RestResponse.class)
            .assertStatus(HttpURLConnection.HTTP_OK)
            .as(XmlResponse.class);
        this.lrequest = rsp.rel("/page/links/link[@rel='lock']/@href")
            .method(Request.POST)
            .body().formParam("name", name).back();
        this.urequest = rsp.rel("/page/links/link[@rel='unlock']/@href")
            .method(Request.GET)
            .uri().queryParam("name", name).back();
    }
View Full Code Here

TOP

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

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.