title: Send String Query With Retrofit
body: <p>Because my previous question was not answered, I decided to ask my question another way.
  I'm trying to send string query to server with retrofit. but the response is null. How to send String query with retrofit?
  When i try the exact URL in browser everything works fine. but the URL that retrofit sends not work. i have to write "search" query Manual. </p>
  
  <p>This is the interface:</p>
  
  <pre><code> @FormUrlEncoded
      @POST("get_near_shop_cat.php")
      Observable&lt;NearShopLocationModel&gt; getNearShopBySearch(@Field("lat") Double lat, @Field("lng") Double lng, @Field("search") String search);
  </code></pre>
  
  <p>This is my calls:</p>
  
  <pre><code>private Observable&lt;NearShopLocationModel&gt; getObservableNearShopBySerach(Double lat,Double lng,String search){
      return NetworkClient.getRetrofit().create(NetworkInterface.class)
              .getNearShopBySearch(lat,lng,search)
              .subscribeOn(Schedulers.io())
              .observeOn(AndroidSchedulers.mainThread());
  }
  
  private DisposableObserver&lt;NearShopLocationModel&gt; getObserverNearShop(){
      return new DisposableObserver&lt;NearShopLocationModel&gt;() {
          @Override
          public void onNext(NearShopLocationModel nearShopLocationModel) {
              smvi.getNearShop(nearShopLocationModel);
          }
  
          @Override
          public void onError(Throwable e) {
              String a=e.getMessage();
          }
  
          @Override
          public void onComplete() {
              smvi.isAllDataLoad(true);
          }
      };
  }
  </code></pre>
  
  <p>And this is the php code from server:</p>
  
  <pre><code>&lt;?php 
  
  //Importing the database connection 
  require_once('DBconnect.php');
  
  $lat = $_GET['lat'];    
  $lng = $_GET['lng'];    
  $search = $_GET["search"];  
  
      //SQL query to fetch data of a range 
      $sql = "SELECT id,title,imageURL1,comment,categoryName,lat,lng, ( 3959 * acos( cos( radians(" . $lat . ") ) * cos( radians( lat ) ) * cos( radians( lng ) - radians(" . $lng . ") ) + sin( radians(" . $lat . ") ) * sin( radians( lat ) ) ) ) 
      AS distance FROM shop WHERE title LIKE CONCAT('%',$search, '%') || categoryName LIKE CONCAT('%',$search, '%') HAVING distance &lt; 5";
  
      //Getting result 
      $res = mysqli_query($con,$sql); 
  
      //Adding results to an array 
      $results = array(); 
  
  
      while($row = mysqli_fetch_array($res)){
              array_push($results, array(
              "id"=&gt;$row['id'],
              "title"=&gt;$row['title'],
              "imageURL1"=&gt;$row['imageURL1'],
              "comment"=&gt;$row['comment'],
              "categoryName"=&gt;$row['categoryName'],
              "lat"=&gt;$row['lat'],
              "lng"=&gt;$row['lng']
              )
              );
  
      }
      //Displaying the array in json format 
      echo json_encode(array("results"=&gt;$results));
  </code></pre>
  
  <p>This is the log from okhttp:</p>
  
  <pre><code>    D/OkHttp: --&gt; POST https://admanandroid.ir/bavand/get_near_shop_cat.php
      Content-Type: application/x-www-form-urlencoded
  D/OkHttp: Content-Length: 85
      lat=35.5092706&amp;lng=46.1725443&amp;search=%DA%A9%D8%A7%D9%85%D9%BE%DB%8C%D9%88%D8%AA%D8%B1
  D/OkHttp: --&gt; END POST (85-byte body)
  </code></pre>
  
  <p>and this is the exact URL that works fine in browser:</p>
  
  <pre><code>https://admanandroid.ir/bavand/get_near_shop_cat.php?lat=35.5092706&amp;lng=46.1725443&amp;search=%22%DA%A9%D8%A7%D9%85%D9%BE%DB%8C%D9%88%D8%AA%D8%B1%22
  </code></pre>
  
  <p>I try with GET but the same result. the response is empty. i think the problem is the 'search' query. if you look at the browser URL the search have %22% in start and end of the string. but the retrofit URL does not have it</p>