title: Flutter response non-json structure form server getting html code
body: <p>when i connect to server for checking username and password like with this structure </p>
  
  <pre><code>{
  "Username":"1",
  "Password":"1"
  }
  </code></pre>
  
  <p>i get <code>0</code> or <code>1</code>, without any json format, first letters of username and password are Capital letters, <strong>U</strong>sername,<strong>P</strong>assword,</p>
  
  <p>now i want to get this response with flutter and <code>post</code> http verb</p>
  
  <p><code>UserInformation</code> class</p>
  
  <pre><code>class UserInformation {
    String Username;
    String Password;
  
    UserInformation(this.Username, this.Password);
  
    Map&lt;String, dynamic&gt; toJson() {
      final Map&lt;String, dynamic&gt; json = new Map&lt;String, dynamic&gt;();
      json['Username'] = this.Username;
      json['Password'] = this.Password;
  
      return json;
    }
  }
  </code></pre>
  
  <p><code>LoginRepository</code> class:</p>
  
  <pre><code>class LoginRepository {
  
    Future&lt;int&gt; authenticate(
        {@required String username, @required String password}) async {
      UserInformation userInformation = UserInformation(username, password);
      /*this line print {Username: 1, Password: 1}*/
      print(userInformation.toJson().toString());
  
      final response = await http.post(
          Constants.loginApi, body: userInformation.toJson());
      final responseString = jsonDecode(response.body);
      if (response.statusCode == 200) {
        return responseString;
      } else {
        throw Exception('fail to get response');
      }
    }
  }
  </code></pre>
  
  <p>and then this output is response from server:</p>
  
  <pre><code>[ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: FormatException: Unexpected character (at character 1)
  ï»¿&lt;?xml version="1.0" encoding="utf-8"?&gt;
  </code></pre>