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

io.github.stewseo.client.transport.Endpoint Maven / Gradle / Ivy

Go to download

java client to build api objects, handle http transport, and parse/deserialize/serialize json to/from json

There is a newer version: 1.8.0
Show newest version
package io.github.stewseo.client.transport;


import io.github.stewseo.client.json.JsonpDeserializer;

import java.util.Collections;
import java.util.Map;

// //An endpoint links requests and responses to HTTP protocol encoding.
// It also defines the error response when the server cannot perform the request.
public interface Endpoint {

    String id();
    String method(RequestT request);

    String requestUrl(RequestT request);

    default Map queryParameters(RequestT request) {
        return Collections.emptyMap();
    }

    default Map headers(RequestT request) {
        return Collections.emptyMap();
    }

    boolean hasRequestBody();
    boolean isError(int statusCode);

    JsonpDeserializer errorDeserializer(int statusCode);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy