Skip to content

Latest commit

 

History

History
 
 

fuel-gson

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

fuel-gson

The gson extension package for Fuel.

Installation

You can download and install fuel-gson with Maven and Gradle. The gson package has the following dependencies:

implementation 'com.github.kittinunf.fuel:fuel:<latest-version>'
implementation 'com.github.kittinunf.fuel:fuel-gson:<latest-version>'

Usage

See FuelGson.kt

Gson Deserialization

  • Fuel also provides a built in support for Gson Deserialization. This is possible by including the Gson module in your dependency block.
data class HttpBinUserAgentModel(var userAgent: String = "")

Fuel.get("/user-agent").responseObject<HttpBinUserAgentModel> { _, _, result -> 
  // handle result similarly as it is shown by the core module
}