I have POST API, i'm using retroFit in my android source code, this is API parameter in POSTMan this is header: enter image description here
This is Body:
Thisis my pseudo Code Android, API interface:
@FormUrlEncoded
@Headers({"Content-Type: multipart/form-data", "Authorization: F31daaw313415"})
@POST("api/store/order")
Call<List<PostCommandResponse>> setCommandeProduct(@FieldMap Map<String, Object> test);
This is my Map
data.put("product_id",productId);
data.put("adress", RequestBody.create(MediaType.parse("multipart/form-data"),adresse));
data.put("city",RequestBody.create(MediaType.parse("multipart/form-data"),city));
data.put("zip",RequestBody.create(MediaType.parse("multipart/form-data"),zip));
data.put("first_name",RequestBody.create(MediaType.parse("multipart/form-data"),surname));
data.put("last_name",RequestBody.create(MediaType.parse("multipart/form-data"),lastname));
But always the response is 400 bad formated request.