title: Retrofit 2.0: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
body: <p>I passed an update user request on postman and got a successful response (see image), Now when I try to do the same in my app, using  Retrofit 2, I get error as <code>com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $</code>. Interestingly I have come across this error earlier, and I know that this usually happens if my Model is not according to the response. But this time I think I have checked all the boxes but sill I'm getting the error. If anybody could figure out where I'am going wrong...</p>
  
  <p>My Response in Postman:</p>
  
  <p><a href="https://i.stack.imgur.com/k2jgB.png" rel="noreferrer"><img src="https://i.stack.imgur.com/k2jgB.png" alt="enter image description here"></a></p>
  
  <p>My Pojo: </p>
  
  <pre><code>package com.example.evidya.Retrofit.Model.EditModel;
  
  import java.util.List;
  import com.google.gson.annotations.Expose;
  import com.google.gson.annotations.SerializedName;
  
  public class EditResponse {
      @SerializedName("result")
      @Expose
      private String result;
  
      @SerializedName("response_code")
      @Expose
      private Integer responseCode;
  
      @SerializedName("msg")
      @Expose
      private String msg;
  
      @SerializedName("data")
      @Expose
      private List&lt;Object&gt; data = null;
  
      public String getResult() {
          return result;
      }
  
      public void setResult(String result) {
          this.result = result;
      }
  
      public Integer getResponseCode() {
          return responseCode;
      }
  
      public void setResponseCode(Integer responseCode) {
          this.responseCode = responseCode;
      }
  
      public String getMsg() {
          return msg;
      }
  
      public void setMsg(String msg) {
          this.msg = msg;
      }
  
      public List&lt;Object&gt; getData() {
          return data;
      }
  
      public void setData(List&lt;Object&gt; data) {
          this.data = data;
      }
  
  }
  </code></pre>
  
  <p>My Retrofit Client:</p>
  
  <pre><code>package com.example.evidya.Retrofit;
  
  import com.example.evidya.Common.Common;
  import com.google.gson.Gson;
  import com.google.gson.GsonBuilder;
  
  import java.util.concurrent.TimeUnit;
  
  import okhttp3.OkHttpClient;
  import okhttp3.logging.HttpLoggingInterceptor;
  import retrofit2.Retrofit;
  import retrofit2.converter.gson.GsonConverterFactory;
  
  public class RetrofitClient {
      public static Retrofit retrofit = null;
      public static Retrofit getRetrofit(){
          HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor();
          loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
  
          OkHttpClient.Builder httpClient = new OkHttpClient.Builder()        //adding custom interceptor
                  .connectTimeout(10, TimeUnit.SECONDS)
                  .readTimeout(20, TimeUnit.SECONDS)
                  .writeTimeout(20, TimeUnit.SECONDS);
          httpClient.addInterceptor(loggingInterceptor); //add logging interceptor as the last interceptor,
                                                         // because this shall also show other interceptors
          Gson gson = new GsonBuilder()
                  .setLenient()
                  .create();
  
          if(retrofit == null){
              retrofit= new Retrofit.Builder()
                      .baseUrl(Common.baseUrl)
                      .addConverterFactory(GsonConverterFactory.create(gson))
                      .client(httpClient.build())
                      .build();
          }
          return retrofit;
      }
  }
  </code></pre>
  
  <p>Retrofit interface:</p>
  
  <pre><code>@FormUrlEncoded
  @PUT("user/update_user")
  Call&lt;EditResponse&gt; updateUser(
      @HeaderMap Map&lt;String, String&gt; headers,
      @Field("user_id") String id,
      @Field("email") String email,
      @Field("name") String name,
      @Field("phone") String phone,
      @Field("access_token") String accessToken
  );
  </code></pre>
  
  <p>My OkHttp Response: 
  <a href="https://i.stack.imgur.com/I8lHx.png" rel="noreferrer"><img src="https://i.stack.imgur.com/I8lHx.png" alt="enter image description here"></a></p>
  
  <p>My Code:</p>
  
  <pre><code>private void saveRequest() {
      Log.d(TAG, "saveRequest: "+loginResponseData.getId());
      progressDialog.setMessage("Updating...");
      progressDialog.show();
      String name, email, mobile;
  
      name = mName.getText().toString();
      email = mEmail.getText().toString();
      mobile = mPhoneNumber.getText().toString();
  
      Call&lt;EditResponse&gt; editResponseCall = evidya.updateUser(Common.getHeaders(), loginResponseData.getId(), email, name, mobile, loginResponseData.getAccessToken());
      editResponseCall.enqueue(new Callback&lt;EditResponse&gt;() {
          private int retryCount = 0;
  
          @Override
          public void onResponse(Call&lt;EditResponse&gt; call, Response&lt;EditResponse&gt; response) {
              progressDialog.dismiss();
              if(!response.isSuccessful()){
                  Toast.makeText(Edit_AccountActivity.this, ""+response.message(), Toast.LENGTH_SHORT).show();
                  return;
              }
  
              EditResponse loginResponse = null;
              try {
                  loginResponse = response.body();
              } catch (Exception e) {
                  Log.d(TAG, "onResponse: error parsing"+e.toString());
              }
  
              if(loginResponse != null){
                  if(loginResponse.getResult().toLowerCase().equals("success")){
                      Toast.makeText(Edit_AccountActivity.this, "Your details successfully updated", Toast.LENGTH_SHORT).show();
                  } else{
                      Toast.makeText(Edit_AccountActivity.this, ""+loginResponse.getMsg(), Toast.LENGTH_SHORT).show();
                  }
  
              } else{
                  Toast.makeText(Edit_AccountActivity.this, "Invalid Response from server", Toast.LENGTH_SHORT).show();
              }
          }
  
          @Override
          public void onFailure(Call&lt;EditResponse&gt; call, Throwable t) {
              Log.d(TAG, "onFailure: "+t.toString());
              Toast.makeText(Edit_AccountActivity.this, ""+t.getMessage(), Toast.LENGTH_SHORT).show();
              progressDialog.dismiss();
          }
  
  
      });
  }
  </code></pre>