title: Retrofit : Url is being changed
body: <p>Currently I am facing some issues with Retrofit. <strong>The URL, I am providing to <code>RetrofitInstance</code> is changing for the second request.</strong> Here are the codes:</p>
  
  <pre><code>object RetrofitClientInstance{
  
       private var retrofit: Retrofit? = null
       //private const val BASE_URL = "http://api.sample.com/req/";
       private const val BASE_URL = "http://test.sample.com/req/"
       private const val BASE_URL_VERSION = "v1/"
  
  
       fun getRetrofitInstance() : Retrofit {
          if (retrofit == null) {
              retrofit = Retrofit.Builder()
                      .baseUrl(BASE_URL + BASE_URL_VERSION)
                      .addConverterFactory(GsonConverterFactory.create())
                      .build()
          }
          return this!!.retrofit!!
      }
  
  }
  </code></pre>
  
  <p>Here are the <code>interface</code> methods for different API requests:</p>
  
  <pre><code>class UserLoginResponseReceiver{
  
      interface GetDataService {
  
          @FormUrlEncoded
          @POST(UrlEndPoints.USER_LOGIN_BY_FACEBOOK)
          fun loginUserByFacebook(@Field("access_token") last: String): Call&lt;FbLoginResponse&gt;
  
          @GET(UrlEndPoints.ALL_POSTS)
          fun getAllPosts() : Call&lt;AllPostsResponse&gt;
  
      }
  }
  </code></pre>
  
  <p><strong>UrlEndPoints.kt</strong></p>
  
  <pre><code>object UrlEndPoints {
  
     const val USER_LOGIN_BY_FACEBOOK = "user/auth/facebook"
     const val ALL_POSTS = "post"
  }
  </code></pre>
  
  <p>For the first request (<strong><em>loginUserByFacebook</em></strong>), the URL I am getting by debugging my response is:</p>
  
  <blockquote>
    <p><a href="http://test.sample.com/req/v1/user/auth/facebook" rel="nofollow noreferrer">http://test.sample.com/req/v1/user/auth/facebook</a></p>
  </blockquote>
  
  <p>Which is fine and working perfectly. But for the second request (<strong><em>getAllPosts()</em></strong>) I am getting the following URL:</p>
  
  <blockquote>
    <p><a href="http://test.sample.com/post" rel="nofollow noreferrer">http://test.sample.com/post</a></p>
  </blockquote>
  
  <p>The <strong>"req/v1"</strong> part is completely cut off! As a result I don't get the desired response. What's the problem here actually? Please help me.</p>