Android beginner here. I am having an issue with Multipart POST request. I am calling my API using POSTMAN and it returns code :200 but when i am calling it from my Application, it returns 503. I found out that this can happen because POSTMAN sends it as multipart by default. I looked through a lot of answers here but i couldn't relate them to my code.
How do i convert my current request into a multipart request?
Here is my interface:
@Multipart
@POST
Call<JsonObject> Login(@Url String url, @Body JsonObject LoginData);
My Interface is as follows :
public Call<JsonObject> Logincall(String teller_ID,String password,String ...}
/*somewhere around here i must do MultipartBody.Part...cant figure out where and how */
RetrofitAPI retrofitAPIObj = RETROBUILDER.create(RetrofitAPI.class);
JsonObject LoginData=new JsonObject();
LoginData.addProperty("teller_ID",teller_ID);
LoginData.addProperty("password",password);
LoginData.addProperty("branch",branch);
LoginData.addProperty("terminal",terminal);
LoginData.addProperty("isSecure",isSecure);
return retrofitAPIObj.Login(RetrofitURL.LOGIN, LoginData);
}
Thanks in advance