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

com.mydaco.client.SyncMydacoClient Maven / Gradle / Ivy

The newest version!
package com.mydaco.client;

import java.io.IOException;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;

import com.google.gson.JsonObject;

public class SyncMydacoClient extends MydacoClient {
	
	private final CloseableHttpClient httpclient = HttpClients.createDefault();
	
	public JsonObject call(String endpointToken, JsonObject parameters) throws IOException {
		HttpPost httpPost = createRequest(endpointToken, parameters);
		HttpResponse response = httpclient.execute(httpPost);
		return readResponse(response);
	}

	@Override
	public void close() throws IOException {
		httpclient.close();
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy