title: Rest API in Flutter Login
body: <p>When I give header and body information inside my http request, it redirects automatically to next page even if i dont give any login credential in my Mobile App.</p>
  <pre><code>Future&lt;Login&gt; fetchLoginData() async {
      final http.Response response = await http.post(
        'http://lmsapi.design.net:88//api/login/login',
        headers: &lt;String, String&gt;{
          'Content-Type': 'application/x-www-form-urlencoded',
          'Authorization': 'Basic XfnatLYBaDO2AKP6KfcIJg=='
        },
  /*        body: {
            'companycode': 'ABC1001',
            'deploymentcode': 'ui11'
          }*/
      );
      if (response.statusCode == 200) {
        // then parse the JSON.
        return Login.fromJson(jsonDecode(response.body));
        } else {
        // then throw an exception.
        throw Exception('Failed to load Data');
      }
    }
  </code></pre>
  <p>Can someone help me how to pass header and body inside my http request?</p>