Skip to content

xiongchen2012/converter-fastjson

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

converter-fastjson

Simple request and response body converter for retrofit2(https://github.com/square/retrofit) via fastjson(https://github.com/alibaba/fastjson)

Download

maven
<dependency>
    <groupId>cn.deathdealer</groupId>
    <artifactId>converter-fastjson</artifactId>
    <version>0.0.1</version>
</dependency>

Usage

    Retrofit retrofit = new Retrofit.Builder()
        .baseUrl("https://api.github.com")
        .addConverterFactory(FastjsonConverterFactory.create())
        .client(new OkHttpClient())
        .build();

or

    FastJsonConfig fastjsonConfig = new FastJsonConfig();
    Retrofit retrofit = new Retrofit.Builder()
        .baseUrl("https://api.github.com")
        .addConverterFactory(FastjsonConverterFactory.create().config(fastjsonConfig))
        .client(new OkHttpClient())
        .build();

Requirements

  • fastjosn version 1.2.x or above
  • retrofit version 2.x or above

Releases

No releases published

Packages

No packages published

Languages