Giter Club home page Giter Club logo

neofit's Introduction

Neofit icon

NEOFIT

Part of CUBA project


Neofit is a library that allows you to quickly and easily develop the client part of the RESTful API service. For the preparation and execution of HTTP requests using an HTTP client OkHttp3. For ease of use the project is divided into several modules:

  • Annotations

    Annotations module contains only declarative annotations for marking your interfaces. Neofit supports come basic HTTP-methods available with prebuilt annotations: @Get, @Post, @Put, @Delete. Despite such a modest arsenal of built-in methods, the Neofit is famous for its extensibility. By using the @Request annotation, you can use a nonstandard method by specifying it as a method parameter.
    The module also contains annotations to describe the requests themselves. @Service defines the base URL for all methods within the interface. This is an optional annotation, but it will make Your life much easier if you need to refactor requests addresses. You can also use variables in the requests URL address, such as </user/{id}>. The value of such a variable is determined by one of the method parameters marked with the @Path annotation. @Query annotation allows you to describe the query parameter passed in its URL after the character <?>.
    @Header and @Headers annotations allows to define custom request headers. @Headers provides a sequence of constant headers, but by @Header can be annotated method parameter. It provides header with variable value.
    @Body, @FormItem and @Part designed to describe the body of the request. You can use @Body to describe a normal query body. @FormItem is used to represent text data as key:value pairs within the query body. @Part is a component of multipart body and is used to transfer a variety of data in the form of body segments. Each part has its own name, content type and, directly, byte array content.

  • Gson

    Gson module contains implementations of few Factories for converting Body (Response and Request), Part and Queries, which contains Json data. Also, by using this module you can convert response into POJO or POJO into request body.

  • Android

    Neofit uses implementations of abstract class Platform for obtaining executors: statement executor and callback executor. Android platform allows to execute statements in ThreadPoolm and Callback in System UI thread

  • Neofit

    Neofit is main module, which contains main functional and tests for it.


Neofit is extremely extensible and customizable. You can manually control the content type of requests, or you can entrust this work to Type Detector for auto-detection. You can pass custom headers, including variable headers, and use custom query types. Neofit offers a wide range of factories for converting data: implementarea them, You can override the algorithms for serialization and deserialization of the request body, including its parts (MultipartBody), the data pairs of the form (FormDataBody) and even query parameters.
All this is already available here and now... By NEOFIT!


Using Neofit

Important!

Neofit does not available in Maven Central or any other certified Maven repository. It can be downloaded from my Public Maven repository. You can add it code into your pom.xml:

    <repositories>
        <repository>
            <id>kllbff-public-releases</id>
            <url>https://github.com/KirillBogatikov/MavenArtifacts/raw/master/releases</url>
        </repository>
        <repository>
            <id>kllbff-public-snapshots</id>
            <url>https://github.com/KirillBogatikov/MavenArtifacts/raw/master/snapshots</url>
        </repository>
    </repositories>

You can add dependency for any module:

  • Main module
    <dependency>  
        <groupId>org.kllbff.cuba.neofit</groupId>  
        <artifactId>neofit</artifactId>  
        <version>1.0.0</version> 
    </dependency>
  • Gson
    <dependency>  
        <groupId>org.kllbff.cuba.neofit</groupId>  
        <artifactId>neofit-gson</artifactId>  
        <version>1.0.0</version> 
    </dependency>
  • Android
    <dependency>  
        <groupId>org.kllbff.cuba.neofit</groupId>  
        <artifactId>neofit-android</artifactId>  
        <version>1.0.0</version> 
    </dependency>

neofit's People

Contributors

dependabot[bot] avatar kirillbogatikov avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.