title: flutter http invalid header name
body: <p>I got a problem with the header. </p>
  
  <blockquote>
    <p>Invalid header field name, with 128</p>
  </blockquote>
  
  <p>One important thing FYI, <em>when I use the JSON MOCK SERVER, it works very well</em>, after switching DOCKER environment I got the error. I would like to add other details. I also test my real back-end code which is works on the docker environment, <strong>I test on the browser with fetch API, and also angular application works well</strong>. <em>I think that there is not related to my back-end or such kind of CORS issues.</em></p>
  
  <pre class="lang-dart prettyprint-override"><code>Future&lt;void&gt; login(String email, String password) async {
     final String url = '$baseUrl/login';
  
     try {
       final http.Response response = await http.post(
         url,
         headers: &lt;String, String&gt;{
           HttpHeaders.contentTypeHeader: 'application/json; charset=UTF-8',
         },
         body: jsonEncode(&lt;String, String&gt;{
           'email': email,
           'password': password,
           'device_name': 'apple',
         }),
       );
  
       if (response.statusCode != 200) {
         throw HttpException('An error occured ${response.statusCode}');
       }
  
       if (response.statusCode == 422) {
         throw UnprocessableEntity('form values not okay');
       }
  
       final Login user = Login.fromJson(json.decode(response.body));
  
       _token = user.data.token;
       _email = email;
  
       final SharedPreferences sharedPreferences =
           await SharedPreferences.getInstance();
       final userData = json.encode({
         'token': _token,
         'email': _email,
       });
       sharedPreferences.setString('userData', userData);
  
       notifyListeners();
     } catch (exception) {
       throw exception;
     }
   }
  </code></pre>