title: Simple login form with Retrofit
body: <p>I'm starting to work with Retrofit but I'm stuck on this simple step. I have a login form and I'm trying to authenticate with the server but I just can't send the request.</p>
  
  <p>This is what I've tried:</p>
  
  <p>My Retrofit client:</p>
  
  <pre><code>private static OkHttpClient.Builder httpClient = new OkHttpClient.Builder();
  
  private static Retrofit.Builder builder =
          new Retrofit.Builder()
                  .baseUrl(API_BASE_URL)
                  .addConverterFactory(GsonConverterFactory.create());
  
  public static &lt;S&gt; S createService(Class&lt;S&gt; serviceClass) {
      Retrofit retrofit = builder.client(httpClient.build()).build();
      return retrofit.create(serviceClass);
  }
  </code></pre>
  
  <p>My login interface:</p>
  
  <pre><code>public interface Login {
  
      @POST(LOGIN)
      Call&lt;String&gt; loginWithCredentials(@Body LoginCredentials data);
  }
  </code></pre>
  
  <p>The LoginCredentials class:</p>
  
  <pre><code>public class LoginCredentials {
  
      private String name;
      private String pass;
  
      public LoginCredentials(String name, String pass) {
          this.name = name;
          this.pass = pass;
      }
  }
  </code></pre>
  
  <p>And the part where I call it:</p>
  
  <pre><code>@Override
  public void onClick(View v) {
  
      showProgress(true);
  
      String username = userField.getText().toString();
      String password = passField.getText().toString();
  
      ApiController.Login loginClient = ApiController.createService(ApiController.Login.class);
      Call&lt;String&gt; call =loginClient.loginWithCredentials(new LoginCredentials(username, password));
      call.enqueue(new Callback&lt;String&gt;() {
          @Override
          public void onResponse(Call&lt;String&gt; call, Response&lt;String&gt; response) {
              handleResponse(response.body());
          }
  
          @Override
          public void onFailure(Call&lt;String&gt; call, Throwable t) {
              showProgress(false);
              Log.e(TAG, t.getLocalizedMessage());
          }
      });
  
  }
  </code></pre>
  
  <p>And I keep getting the error <code>Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $</code>but I have no idea what it means.</p>