request logging closed
This commit is contained in:
@@ -1,15 +1,9 @@
|
||||
package ch.pizzalink.android.api;
|
||||
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import ch.pizzalink.android.model.AddNewAddressResponseModel;
|
||||
import ch.pizzalink.android.model.AddProductToBasketResponseModel;
|
||||
import ch.pizzalink.android.model.AddToBasketOptionModel;
|
||||
import ch.pizzalink.android.model.AddressModel;
|
||||
import ch.pizzalink.android.model.AppVersionModel;
|
||||
import ch.pizzalink.android.model.CountryModel;
|
||||
@@ -25,7 +19,6 @@ import ch.pizzalink.android.model.CategoryModel;
|
||||
import ch.pizzalink.android.model.OrderHistoryModel;
|
||||
import ch.pizzalink.android.model.UserModel;
|
||||
import ch.pizzalink.android.model.menu.MenuProductModel;
|
||||
import okhttp3.MultipartBody;
|
||||
import okhttp3.RequestBody;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.Body;
|
||||
@@ -33,11 +26,7 @@ import retrofit2.http.Field;
|
||||
import retrofit2.http.FieldMap;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Headers;
|
||||
import retrofit2.http.Multipart;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Part;
|
||||
import retrofit2.http.PartMap;
|
||||
import retrofit2.http.Query;
|
||||
import retrofit2.http.Url;
|
||||
|
||||
@@ -81,10 +70,15 @@ public interface ApiInterface {
|
||||
@POST(ApiEndPoints.API_GET_PRODUCT)
|
||||
Call<ResponseArray<MenuProductModel>> getProductById(@Field("product_id") int productId);
|
||||
|
||||
/*
|
||||
* Bu projedeki post servisler bizden form-data bekliyor. Bu serviste @FormUrlEncoded yapınca ve
|
||||
* body'i @FieldMap HashMap<String, Object> body olarak verince, body içindeki alanlar
|
||||
* encode ediliyor, mesela body içindeki "[" karakteri "%5D" ye falan dönüşüyor, dolayısı ile servis bunları okuyamıyor.
|
||||
* Bu sebeple body olarak RequestBody verdim ve servisi çağırırken bod içindeki alanları FormBody olarak ekledim.
|
||||
*/
|
||||
@POST
|
||||
Call<ResponseObject<AddProductToBasketResponseModel>> addProductsToBasket(@Url String url,
|
||||
@Body RequestBody body);
|
||||
|
||||
@GET(ApiEndPoints.API_GET_SHIPPING_METHODS)
|
||||
Call<ResponseArray<ShippingMethodModel>> getShippingMethods(@Query("token") String token);
|
||||
|
||||
@@ -95,13 +89,10 @@ public interface ApiInterface {
|
||||
@POST
|
||||
Call<ResponseObject<AddNewAddressResponseModel>> addNewAddress(@Url String url,
|
||||
@FieldMap HashMap<String, Object> body);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST
|
||||
Call<ResponseObject<DeleteAddressResponseModel>> deleteAddress(@Url String url,
|
||||
@Field("address_id") String addressId);
|
||||
|
||||
|
||||
@GET(ApiEndPoints.API_GET_PAYMENT_METHODS)
|
||||
Call<ResponseObject<PaymentMethodsResponseModel>> getPaymentMethods(@Query("token") String token);
|
||||
|
||||
@@ -142,7 +133,6 @@ public interface ApiInterface {
|
||||
@POST
|
||||
Call<ResponseObject<RemoveProductFromCartResponseModel>> removeProductFromCart(@Url String url,
|
||||
@FieldMap HashMap<String, Object> body);
|
||||
|
||||
@GET(ApiEndPoints.API_GET_STORE_INFO)
|
||||
Call<ResponseObject<StoreInfoModel>> getStoreInfo();
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ public class ApiService {
|
||||
|
||||
HttpLoggingInterceptor logging = new HttpLoggingInterceptor(); // set your desired log level
|
||||
logging.setLevel(HttpLoggingInterceptor.Level.BODY);
|
||||
builder.addInterceptor(logging);
|
||||
//builder.addInterceptor(logging);
|
||||
|
||||
OkHttpClient client = builder.build();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user