i'm using drf api in my kotlin app, how can i check for connection? package…
- User
i'm using drf api in my kotlin app, how can i check for connection? package com.example.neurea.api
import com.example.neurea.models.Book import com.example.neurea.models.Bookmarked import com.example.neurea.models.BooksResponse import com.example.neurea.models.GenresResponse import com.example.neurea.models.RegisterRequest import com.example.neurea.models.RegisterResponse import com.example.neurea.models.SearchTipsResponse import com.example.neurea.models.TokenRequest import com.example.neurea.models.TokenResponse import com.example.neurea.models.User import com.example.neurea.models.UserProfileUpdate import okhttp3.MultipartBody import retrofit2.Call import retrofit2.http.Body import retrofit2.http.DELETE import retrofit2.http.GET import retrofit2.http.Multipart import retrofit2.http.PATCH import retrofit2.http.POST import retrofit2.http.Part import retrofit2.http.Path import retrofit2.http.Query
interface Api { @POST("api/v1/auth/token/") fun createToken(@Body authRequest: TokenRequest): Call
code@POST("api/v1/auth/token/refresh/") fun refreshToken(@Body refreshRequest: HashMap<String, String>): Call<TokenResponse> @POST("api/v1/auth/create/") fun registerUser(@Body registerRequest: RegisterRequest): Call<RegisterResponse> @GET("api/v1/auth/update/") fun getUserProfile(): Call<User> @DELETE("api/v1/auth/update/") fun deleteUserProfile(): Call<Unit> @Multipart @PATCH("api/v1/auth/update/") fun updateUserAvatar(@Part avatar: MultipartBody.Part): Call<User> @PATCH("api/v1/auth/update/") fun updateUserProfile(@Body userProfileUpdate: UserProfileUpdate): Call<User> @GET("api/v1/book/") fun getBooks(@Query("page") page: Int, @Query("limit") limit: Int): Call<BooksResponse> @GET("/api/v1/book/recomendation/") fun getRecommendations(): Call<List<Book>> @GET("api/v1/genre/") fun getGenres(@Query("page") page: Int, @Query("limit") limit: Int): Call<GenresResponse> @GET("api/v1/genre/{uuid}/books/") fun getBooksByGenre(@Path("uuid") genreId: String): Call<BooksResponse> @GET("api/v1/ubc/bookmarked/{book_uuid}/") fun getIsBookmarked(@Path("book_uuid") uuid: String): Call<Bookmarked> @GET("api/v1/book/search-tips/") fun getSearchTips(@Query("q") query: String): Call<SearchTipsResponse> @GET("api/v1/book/{uuid}") fun getBookDetail(@Path("uuid") uuid: String): Call<Book> - Assistant
- User
but can i make that with get request to my server?
- Assistant