Skip to content
forked from Umutayb/wasapi

Api integration & testing simplified.

License

Notifications You must be signed in to change notification settings

egecansen/wasapi

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wasapi

Maven Central

Wasapi is a lightweight, Java-based API utility library that simplifies HTTP service generation and API calls using Retrofit. It abstracts the boilerplate needed to set up and use APIs, making it easier to integrate network calls in your Java applications.

Features

  • Simplified API service generation
  • Centralized HTTP configuration
  • Easy-to-use wasapi.Caller utility for handling requests
  • Designed with modularity and readability in mind

Getting Started

Installation

Add the required dependency to your project.

Maven

<!-- Wasapi -->
<dependency>
    <groupId>io.github.umutayb</groupId>
    <artifactId>wasapi</artifactId>
    <version>0.0.1</version>
</dependency>

Usage

1. Define your API interface

public interface MyApiServices {
    @GET("endpoint")
    Call<MyResponse> getData();
}

2. Create your service instance

import wasapi.WasapiClient;

MyApiServices api = new WasapiClient.Builder()
        .baseUrl("https://api.example.com/")
        .build(MyApiServices.class);

3. Make API calls using wasapi.Caller

import retrofit2.Call;
import wasapi.WasapiUtilities;

class MyApi extends WasapiUtilities {

    MyApiServices api = new WasapiClient.Builder()
            .baseUrl("https://api.example.com/")
            .build(MyApiServices.class);

    public MyResponse main(String[] args) {
        Call apicall = api.getData();
        return perform(apicall);
    }
}

Structure

  • wasapi.WasapiClient: Handles Retrofit service instantiation and base URL setup.
  • wasapi.Caller: Utility to execute API calls and process callbacks in a consistent way.
  • wasapi.WasapiUtilities: A utility class that provides utility methods for building multipart requests from files, monitoring HTTP response codes and validating fields in API responses.

Contributing

Contributions are welcome! If you’d like to contribute, open an issue or submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Api integration & testing simplified.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%