Unirest and connect with API
<p>I write project in <code>Java</code> using <code>Maven</code> and to <code>REST</code> app using <code>Unirest</code> lib.</p>

<p>My dependencies in <code>pom.xml</code> looks like :</p>

<pre><code>    &lt;dependency&gt;
        &lt;groupId&gt;org.apache.httpcomponents&lt;/groupId&gt;
        &lt;artifactId&gt;httpclient&lt;/artifactId&gt;
        &lt;version&gt;4.3.6&lt;/version&gt;
    &lt;/dependency&gt;

    &lt;dependency&gt;
        &lt;groupId&gt;org.apache.httpcomponents&lt;/groupId&gt;
        &lt;artifactId&gt;httpasyncclient&lt;/artifactId&gt;
        &lt;version&gt;4.0.2&lt;/version&gt;
    &lt;/dependency&gt;

    &lt;dependency&gt;
        &lt;groupId&gt;org.apache.httpcomponents&lt;/groupId&gt;
        &lt;artifactId&gt;httpmime&lt;/artifactId&gt;
        &lt;version&gt;4.3.6&lt;/version&gt;
    &lt;/dependency&gt;

    &lt;dependency&gt;
        &lt;groupId&gt;org.json&lt;/groupId&gt;
        &lt;artifactId&gt;json&lt;/artifactId&gt;
        &lt;version&gt;20140107&lt;/version&gt;
    &lt;/dependency&gt;

    &lt;dependency&gt;
        &lt;groupId&gt;com.mashape.unirest&lt;/groupId&gt;
        &lt;artifactId&gt;unirest-java&lt;/artifactId&gt;
        &lt;version&gt;1.4.7&lt;/version&gt;
    &lt;/dependency&gt;
</code></pre>

<p>And I want connect with url <code>https://demo-api.ig.com/gateway/deal</code>. It is exchange provider and I want get response from provider so I must send information like in <a href="http://labs.ig.com/rest-trading-api-guide" rel="nofollow">Example 1: Logging in</a>.</p>

<p>How can I do this with <code>Unirest</code> ? </p>

<p>I try something like this : </p>

<pre><code>HttpResponse&lt;JsonNode&gt; jsonResponse = Unirest.post(url)
                .header("Content-Type", "application/json; charset=UTF-8")
                .header("Accept", "application/json; charset=UTF-8")
                .queryString("X-IG-API-KEY", "52d5bc6eee5f2c1775ac4cxz85ef4356c12d23a7")
                .asJson();
</code></pre>

<p>... but I need also give information abour my <code>login</code> and <code>password</code></p>