Gait Boxman

Manager Advanced Technologies & Standards at TIE Kinetix

Gait Boxman is the Owner of Boxman Software Consultancy. Prior to this, they were the Domain Coordinator UN/EDIFACT at UN/CEFACT from 2000 to present. Before that, they were the Manager Advanced Technologies & Standards at TIE Kinetix from 1996 to 2000.

package com.example.mvvmdemo.data.network

import com.example.mvvmdemo.data.network.responses.AuthResponse

import okhttp3.ResponseBody

import retrofit2.Call

import retrofit2.Response

import retrofit2.Retrofit

import retrofit2.converter.gson.GsonConverterFactory

import retrofit2.http.Field

import retrofit2.http.FormUrlEncoded

import retrofit2.http.POST

interface MyApi {

@FormUrlEncoded

@POST("login")

suspend fun userLogin(

@Field("email") email: String,

@Field("password") password: String

): Response<AuthResponse>

companion object {

operator fun invoke(): MyApi {

return Retrofit.Builder()

.baseUrl("https://api.simplifiedcoding.in/course-apis/mvvm/")

.addConverterFactory(GsonConverterFactory.create())

.build()

.create(MyApi::class.java)

}

}

}

Links