Closed fernandohackbart closed 7 years ago
Checking the JSON Model Generator plugin, looks promising
After moving to Kotling the procedure changed
fun createBiker(context: Context, createBikerrequest: BikerCreateRequest) {
defaults(context)
val preferences: Preferences? = Preferences(context)
val gson = GsonBuilder().setPrettyPrinting().create()
Fuel.post("/api/authn/biker").body(gson.toJson(createBikerrequest)).responseObject(BikerToken.Deserializer()){ req, res, result ->
val (bikerTokenRsp, err) = result
preferences?.clientToken=bikerTokenRsp?.token!!.authToken
preferences?.bikerID=bikerTokenRsp?.bikerID!!.bikerID
}
}
Use gson
Make it easy to reference the payload received