All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.openrest.v1_1.OpenrestClient Maven / Gradle / Ivy

There is a newer version: 1.39.0
Show newest version
package com.openrest.v1_1;

import java.io.IOException;

import com.fasterxml.jackson.core.type.TypeReference;
import com.google.api.client.http.HttpRequestFactory;

/** The Openrest client. */
public class OpenrestClient {
    private final String apiUrl;
    private final OpenrestProtocol protocol;

    public OpenrestClient(HttpRequestFactory requestFactory, Integer connectTimeout, Integer readTimeout,
                          Integer numberOfRetries, String apiUrl) {
        this.apiUrl = apiUrl;
        protocol = new OpenrestProtocol(requestFactory, connectTimeout, readTimeout, numberOfRetries);
    }
    
    public  T request(Request request, TypeReference> responseType) throws IOException, OpenrestException {
        return protocol.post(apiUrl, request, responseType);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy