Skip to content

Latest commit

 

History

History
 
 

fuel-gson

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

fuel-gson

Kotlin

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:

  • fuel:fuel:<same-version>
  • Kotlin: 1.3.20
  • Gson: 2.8.5
compile 'com.github.kittinunf.fuel:fuel:<latest-version>'
compile '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 -> }