title: working with REST API
body: <p>Working with REST API (<a href="https://qwintry.com/ru/api-docs" rel="nofollow">https://qwintry.com/ru/api-docs</a>), trying make method which will register new user.
  There is the part of API docs about registering user request:</p>
  
  <pre><code>Login
  Request example:
  &lt;?php
      define('site_url', 'qwintry.com');
      $url =  'https://' . site_url.'/api-rest/v2/user/login';
      $data = array ( 
              'email' =&gt; 'op@b.c',
              'password' =&gt; '123',
              'key' =&gt; '9e4fddbb3adc4c67f74bb2b7757cebf9',
       );
      $data_string = http_build_query($data);
  
      $ch = curl_init();
      curl_setopt($ch, CURLOPT_URL, $url);
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
      curl_setopt($ch, CURLOPT_POST, true);
      curl_setopt($ch, CURLOPT_POSTFIELDS,  $data_string);
      curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
      curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
      curl_setopt($ch, CURLOPT_HEADER, 1);
      $response = curl_exec($ch);
      curl_close($ch);
      print_r($response);
  Parameters:
  email — E-mail of user
  password — Password
  key — Unique key of request
  </code></pre>
  
  <p>There is my implementation of method loginUser:</p>
  
  <pre><code>@Service
  public class LogisticServiceImpl implements LogisticService {
      private final String BASE_URL = "http://www.qwintry.com/api-rest/v2";
  
      @Override
      public String userLogin(String email, String password) throws Exception {
          String url = BASE_URL + "/user/login";
          Map&lt;String, Object&gt; params = new HashMap&lt;&gt;();
          params.put("email", email);
          params.put("password", password);
          HttpResponse&lt;String&gt; jsonResponse = Unirest.post(url).fields(params).asString();
  
          return jsonResponse.getBody();
      }
  </code></pre>
  
  <p>Getting such response permanently:</p>
  
  <blockquote>
    <p> 301 Moved Permanently  <h1>301 Moved Permanently</h1>
    <hr>nginx  </p>
  </blockquote>
  
  <p>expected Json format.
  What I'm doing wrong?</p>