title: Flutter Http post call Doesn't work on web and works on mobile only
body: <pre><code>  loginUser(email, password) async {
      var url = Uri.parse
          .call(&quot;https://us-central1-agenie-webapp.cloudfunctions.net/api/login&quot;);
      final http.Response response = await http.post(
        url,
        headers: &lt;String, String&gt;{
          'Content-Type': 'application/json',
        },
        body: jsonEncode(&lt;String, String&gt;{'email': email, 'password': password}),
      );
      if (response.statusCode == 200) return response.body;
      return null;
    }
  </code></pre>
  <p>This is the api post call when I run this on web localhost with flutter run ,when I click on login button that calls this function on pressed it open a window in vscode named browser_client.dart and goes to line 69 where it shows :</p>
  <pre><code> unawaited(xhr.onError.first.then((_) {
        // Unfortunately, the underlying XMLHttpRequest API doesn't expose any
        // specific information about the error itself.
        completer.completeError(
            ClientException('XMLHttpRequest error.', request.url),
            StackTrace.current);
      }));
  </code></pre>
  <p>Any solutions ? Thanks</p>