title: java.io.EOFException: End of input at line 1 column 1
body: <p>My <code>Retrofit</code> should recieve a List of Bookmarks, and everything worked while I was using <code>WAMP</code> server. When I changed server to external (nothing else changed, just ip address of the server and retrieving of everything else works) I have an error:</p>
  
  <pre><code> java.io.EOFException: End of input at line 1 column 1
                     at com.google.gson.stream.JsonReader.nextNonWhitespace(JsonReader.java:1407)
                     at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:553)
                     at com.google.gson.stream.JsonReader.peek(JsonReader.java:429)
                     at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:74)
                     at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61)
                     at retrofit2.converter.gson.GsonResponseBodyConverter.convert(GsonResponseBodyConverter.java:37)
                     at retrofit2.converter.gson.GsonResponseBodyConverter.convert(GsonResponseBodyConverter.java:25)
                     at retrofit2.ServiceMethod.toResponse(ServiceMethod.java:116)
                     at retrofit2.OkHttpCall.parseResponse(OkHttpCall.java:211)
                     at retrofit2.OkHttpCall$1.onResponse(OkHttpCall.java:106)
                     at okhttp3.RealCall$AsyncCall.execute(RealCall.java:135)
                     at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
                     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
                     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
                     at java.lang.Thread.run(Thread.java:818)
  </code></pre>
  
  <p><strong>My Retrofit code:</strong></p>
  
  <pre><code>public void init() {
          OkHttpClient.Builder okHttpClient = new OkHttpClient.Builder();
  
          HttpLoggingInterceptor debugger =
                  new HttpLoggingInterceptor()
                          .setLevel(HttpLoggingInterceptor.Level.BODY);
          okHttpClient
                  .addInterceptor(debugger);
  
          Retrofit retrofit = new Retrofit.Builder()
                  .baseUrl(Constants.BASE_URL)
                  .addConverterFactory(GsonConverterFactory.create())
                  .client(okHttpClient.build())
                  .build();
  
          RequestInterface requestInterface = retrofit.create(RequestInterface.class);
  
          String email = pref.getString(Constants.EMAIL, "");
          System.out.println(email);
          String id_group = pref.getString(Constants.ID_GROUP, "");
          System.out.println(id_group);
          String nazwa = pref.getString(Constants.NAZWA, "");
  
          Integer id_int_group = Integer.parseInt(id_group);
          Bookmark bookmark = new Bookmark(email, id_int_group, nazwa);
  
          ServerRequest request2 = new ServerRequest();
          request2.setOperation(Constants.GET_MY_GROUPS);
          request2.setBookmark(bookmark);
  
          Call&lt;List&lt;Bookmark&gt;&gt; response2 = requestInterface.operation2(request2);
  
          response2.enqueue(new Callback&lt;List&lt;Bookmark&gt;&gt;() {
  
              @Override
              public void onResponse(Call&lt;List&lt;Bookmark&gt;&gt; call, retrofit2.Response&lt;List&lt;Bookmark&gt;&gt; response2) {
                  listOfBookmarks = response2.body();
                  bookmarkToString();
                  simpleAdapter.notifyDataSetChanged(); // refresh listivew
              }
  
              @Override
              public void onFailure(Call&lt;List&lt;Bookmark&gt;&gt; call, Throwable t) {
  
                  Log.d(Constants.TAG, "Nie zaladowano!", t);
  
              }
          });
      }
  </code></pre>
  
  <p><strong>EDIT://</strong>
  PHP code:</p>
  
  <pre><code>&lt;?php
  
  class Bookmark {
  
      private $host = 'localhost';
      private $user = 'nwbrn_root';
      private $db = 'nwbrn_app';
      private $pass = 'zxs@1208NMLK';
      private $conn;
  
  public function __construct() {
  
     $this -&gt; conn = new PDO("mysql:host=".$this -&gt; host.";dbname=".$this -&gt; db, $this -&gt; user, $this -&gt; pass);
  
  }
  
  
   public function checkBookmarkExist($email, $id_group){
  
      try {
       $query = $this-&gt;conn-&gt;prepare("SELECT COUNT(*) from bookmarks WHERE email =:email AND id_group =:id_group");
  
  //     $query = $this -&gt; conn -&gt; prepare($sql);
       $query-&gt;bindParam(':email', $email, PDO::PARAM_STR);
       $query-&gt;bindParam(':id_group', $id_group, PDO::PARAM_INT);
       $query-&gt;execute(array('email' =&gt; $email, 'id_group' =&gt; $id_group));
  
       $row_count = $query -&gt; fetchColumn();
      if ( $row_count&gt;0 ) {
          $response["result"] = "success";
          $response["message"] = "Your favourite!";
          return json_encode($response);
      }
      else {
          $response["result"] = "failure";
          $response["message"] = "Not in your favourite!";
          return json_encode($response);
      }
  } catch (PDOException $e) {
      die ($e-&gt;getMessage());
  }   
  }
  
  public function fullStarSelected($email, $id_group, $nazwa){
  
      try {
  
       $query = $this-&gt;conn-&gt;prepare("DELETE from bookmarks WHERE email =:email AND id_group =:id_group AND nazwa =:nazwa");
  //        mysqli_set_charset($this-&gt;conn, "utf8");
  
  
          $query-&gt;bindParam(':email', $email, PDO::PARAM_STR);
       $query-&gt;bindParam(':id_group', $id_group, PDO::PARAM_INT);
       $query-&gt;bindParam(':nazwa', $nazwa, PDO::PARAM_STR);
          $query-&gt;execute();
  
      if ( $query -&gt;rowCount() &gt; 0 ) {
          $response["result"] = "failure";
          $response["message"] = "Row not deleted!";
          return json_encode($response);
      }
      else {
          $response["result"] = "success";
          $response["message"] = "Row deleted successfully!";
          return json_encode($response);
      }
  } catch (PDOException $e) {
      die ($e-&gt;getMessage());
  }   
  }
  
  public function blankStarSelected($email, $id_group, $nazwa){
  
      try {
       $query = $this-&gt;conn-&gt;prepare("INSERT INTO bookmarks (email, id_group, nazwa) VALUES (:email, :id_group, :nazwa)");
  //        mysqli_set_charset($this-&gt;conn, "utf8");
  
          $query-&gt;bindParam(':email', $email, PDO::PARAM_STR);
       $query-&gt;bindParam(':id_group', $id_group, PDO::PARAM_INT);
       $query-&gt;bindParam(':nazwa', $nazwa, PDO::PARAM_STR);
       $query-&gt;execute();
  
          if (!$query) {
              printf("Error: %s\n", mysqli_error($this-&gt;conn));
              exit();
          }
  
       $result = array();
  
  //        $query1 = $this-&gt;conn-&gt;prepare("SELECT COUNT(*) from bookmarks WHERE email =:email AND id_group =:id_group LIMIT 1");
  
          if ( $query-&gt;rowCount() &gt; 0 ) {
              $response["result"] = "success";
              $response["message"] = "Row added successfully!";
              return json_encode($response);
          }
          else {
              $response["result"] = "failure";
              $response["message"] = "Row not added!";
              return json_encode($response);
          }
  
  
  } catch (PDOException $e) {
      die ($e-&gt;getMessage());
  }   
  }
  
      public function getMyGroups($email, $id_group){
  
          try {
  
             $con = mysqli_connect($this-&gt;host,$this-&gt;user,$this-&gt;pass,$this-&gt;db);
  
              $sql = "SELECT * FROM bookmarks WHERE email = '$email'";
              $res = mysqli_query($con,$sql);
  
              $result = array();
  
              if (!$res) {
                  printf("Error: %s\n", mysqli_error($con));
                  exit();
              }
  
              while($row = mysqli_fetch_array($res)){
                  $temp = array();
                  $temp['id_group']=$row['id_group'];
                  $temp['email']=$row['email'];
                  $temp['nazwa']=$row['nazwa'];
  
                  array_push($result,$temp);
              }
  
              echo json_encode($result);
  
          } catch (PDOException $e) {
              die ($e-&gt;getMessage());
          }
  
      }
  }
  </code></pre>