Skip to content

Latest commit

 

History

48 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

http-integrations

A Java library that provides structured, extensible wrappers for building API integration clients over HTTP.

What it does

http-integrations gives you a small set of well-defined abstractions — Calls, Transports, Options, and Clients — that cover the full lifecycle of an HTTP API call: building the request body, sending it, and parsing the response. The goal is a consistent pattern that every API client in a project follows, so integrations are predictable, testable, and easy to extend.

Modules

Module Description
core Foundation types: base exception hierarchy, the Option abstraction, and the Options utility. Compiled for Java 8+.
http HTTP-specific layer built on the core module: transport implementations, client base classes, Jackson serialization support, request/response logging, and HTTP option factories. Requires Java 21.

Requirements

  • Java 21 (for the http module; core targets Java 8)
  • Maven (project uses Maven Wrapper — ./mvnw / mvnw.cmd)

Build

./mvnw clean package

Basic usage

  1. Implement Call<R, C> for each API operation.
  2. Extend AbstractHttpIntegrationClient (or SimpleHttpIntegrationClient) as the client for the external service.
  3. Wire a NativeHttpTransport and pass options such as authentication headers or timeouts.
// Create a transport (connection pool enabled by default)
NativeHttpTransport transport = new NativeHttpTransport(
    HttpOptions.bearerAuth("my-token"),
    Options.timeout(Duration.ofSeconds(10))
);

// Instantiate the client for a specific service
MyApiClient client = new MyApiClient(transport, MyApiClient.URL_PRODUCTION);

// Execute a call
MyDomainObject result = new MyGetItemCall(itemId).execute(client);

See http/src/main/java/.../example/HttpBinClient.java for a working example.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages