Package io.fathom.http

Examples of io.fathom.http.HttpClient.buildRequest()


        // Fetch the root page; this warms-up the app
        try {
            HttpClient httpClient = JreHttpClient.create();
            URI uri = URI.create("http://127.0.0.1:8080/");
            HttpRequest httpRequest = httpClient.buildRequest(HttpMethod.GET, uri);
            try (HttpResponse response = httpRequest.doRequest()) {
                if (response.getHttpResponseCode() != 200) {
                    throw new IllegalStateException("Bad response code from page: " + response.getHttpResponseCode());
                }
            }
View Full Code Here


    public V2AuthResponse doLogin(V2AuthRequest authRequest, CertificateAndKey certificateAndKey)
            throws RestClientException {
        URI uri = resolve("v2.0/tokens");

        HttpClient httpClient = getHttpClient(certificateAndKey);
        HttpRequest httpRequest = httpClient.buildRequest(HttpMethod.POST, uri);
        addHeaders(httpRequest);

        addHeaders(httpRequest, certificateAndKey);

        setEntityJson(httpRequest, authRequest);
View Full Code Here

    public RegisterResponse register(RegisterRequest request, CertificateAndKey certificateAndKey)
            throws RestClientException {
        URI uri = resolve("extensions/register");

        HttpClient httpClient = getHttpClient(certificateAndKey);
        HttpRequest httpRequest = httpClient.buildRequest(HttpMethod.POST, uri);
        addHeaders(httpRequest);

        addHeaders(httpRequest, certificateAndKey);

        setEntityJson(httpRequest, request);
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.