title: How to avoid URL encoding in Retrofit?
body: <p>I'm using retrofit for my network layer I'm facing a strange issue I've the parameter and it's value look like this </p>
  
  <blockquote>
    <p>store://0TxIGQMQbObzvU4Apia0V0&amp;callback=</p>
  </blockquote>
  
  <p>and after encoding it changes to this </p>
  
  <blockquote>
    <p>store://0TxIGQMQbObzvU4Apia0V0%26callback%3D</p>
  </blockquote>
  
  <p>and for some reason server is not liking this encoding and I'm getting "HTTP 400 Bad Request". </p>
  
  <p>If I hit without encoding it runs fine so I was wondering is there is any way i can disable the endoing.</p>
  
  <p>I've tried other ways like this </p>
  
  <pre><code>@Query(value "env" encoded = false) String env
  </code></pre>
  
  <p>but no luck. </p>
  
  <p>This is my network interface class</p>
  
  <pre><code>public interface NetworkService
  {
      @GET("v1/public/yql")
      Observable&lt;SeriesEntity&gt; getOnGoingSeries(@Query("q") String query,
                                                @Query("format") String format,
                                                @Query("diagnostics") boolean flag,
                                                @Query("env") String env);
  
  
      class Factory {
          public  static NetworkService create()
          {
              OkHttpClient.Builder clientBuilder = new OkHttpClient.Builder();
              HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor();
              loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
              clientBuilder.addInterceptor(loggingInterceptor);
  
              Gson gson = new GsonBuilder().disableHtmlEscaping().create();
  
              Retrofit retrofit = new Retrofit.Builder()
                      .baseUrl("https://query.yahooapis.com")
                      .client(clientBuilder.build())
                      .addConverterFactory(GsonConverterFactory.create())
                      .addCallAdapterFactory(RxJava2CallAdapterFactory.create())
                      .build();
  
              return retrofit.create(NetworkService.class);
          }
      }
  }
  </code></pre>
  
  <p><strong>Edit :</strong></p>
  
  <p>I also notice that the issue is only the encoded value of '&amp;' because if i replace it value (whic is %26) it works fine </p>