Ayden
12/21/2019, 9:06 AMprivate val retrofit = Retrofit.Builder()
// .baseUrl(Constant.URL + Constant.VERSION)
.baseUrl("<http://192.168.1.128:5000/api/>")
.addConverterFactory(GsonConverterFactory.create())
.build()
interface RegisterRepository {
@FormUrlEncoded
@POST("/api/register")
suspend fun register(
@Field("email") email: String,
@Field("password") password: String
)User
}
object RegisterApi {
val retrofitService : RegisterRepository by lazy {
retrofit.create(RegisterRepository::class.java)
}
}
Pablichjenkov
12/21/2019, 9:22 AM/api
path might be repeated. Also using direct ip address can generate issues with certificate verification, however you are using http not https so would be fine.zhuinden
01/03/2020, 10:23 AM@POST("api/register")