title: Using Retrofit 2 but, have Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
body: <p>I make <a href="https://api.flickr.com/services/rest/?method=flickr.photos.getRecent&amp;api_key=eab3aa7d564989fd69048ec505e3e271&amp;format=json&amp;nojsoncallback=1" rel="nofollow">request</a> get photos from Flickr, using Retrofit 2.</p>
  
  <p>I create a class for parsing it:</p>
  
  <pre><code>    public class FlickrResult {
  
      @SerializedName("photos")
      @Expose
      private FlickrPhotos photos;
  
      @SerializedName("stat")
      @Expose
      private String stat;
  
      public FlickrPhotos getPhotos() {
          return photos;
      }
  
  
      public class FlickrPhotos {
  
          @SerializedName("page")
          @Expose
          private int page;
  
          @SerializedName("pages")
          @Expose
          private String pages;
  
          @SerializedName("perpage")
          @Expose
          private int perpage;
  
          @SerializedName("total")
          @Expose
          private String total;
  
          @SerializedName("photo")
          @Expose
          private ArrayList&lt;FlickrPhoto&gt; photo;
  
          public ArrayList&lt;FlickrPhoto&gt; getPhoto() {
              return photo;
          }
  
  
          public class FlickrPhoto {
  
              @SerializedName("id")
              @Expose
              private String id;
  
              @SerializedName("owner")
              @Expose
              private String owner;
  
              @SerializedName("secret")
              @Expose
              private String secret;
  
              @SerializedName("server")
              @Expose
              private String server;
  
              @SerializedName("farm")
              @Expose
              private int farm;
  
              @SerializedName("title")
              @Expose
              private String title;
  
              @SerializedName("ispublic")
              @Expose
              private int ispublic;
  
              @SerializedName("isfriend")
              @Expose
              private int isfriend;
  
              @SerializedName("isfamily")
              @Expose
              private int isfamily;
  
              public String getTitle() {
                  return title;
              }
          }
  
      }
  
    }
  </code></pre>
  
  <p>My build request is:</p>
  
  <pre><code> static {
          gson = new GsonBuilder()
                  .setLenient()
                  .create();
      }
  
  
  
   @NonNull
      private static Retrofit buildRetrofit() {
          Log.i(TAG, "onBuildRetrofitApiFactory");
          return new Retrofit.Builder()
                  .baseUrl("https://api.flickr.com/services/")
                  .client(getClient())
                  .addConverterFactory(GsonConverterFactory.create(gson))
                  .build();
      }
  </code></pre>
  
  <p>Retrofit interface</p>
  
  <pre><code>@GET("rest")  
          Call&lt;FlickrResult&gt; getPhotos(@Query("method") String method,
                                       @Query("api_key") String key,
                                       @Query("format") String format,
                                       @Query ("nojsoncallbac") String nojsoncallbac
                                                      );
  </code></pre>
  
  <p>Me responsable is success, but problem in parsing. Have exeption: </p>
  
  <h2>java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $</h2>
  
  <p>Please guys, i need you help!</p>