title: SocketException: OS Error: Connection refused, errno = 111, address = localhost, port = 37312 while http post
body: <p>I'm trying to post data to node API from flutter. my code is as follows.</p>
  <pre><code>final String uri = &quot;http://localhost:3000&quot;;
  Map&lt;String, String&gt; userBody = {
  &quot;firstName&quot;:&quot;Vishal&quot;,
  &quot;lastName&quot;:&quot;Soni&quot;,
  &quot;email&quot;:&quot;vishal@gmail.com&quot;,
  &quot;mobile&quot;:&quot;1234567890&quot;,
  &quot;password&quot;:&quot;123&quot;,
  };
  
  Future&lt;dynamic&gt; postData() async {
  try {
    http.Response res = await http.Client().post(&quot;$uri/register&quot;, body: jsonEncode(userBody), headers:    {
      'Content-Type': 'application/json',
    });
    print(res);
  } catch (e) {
    print(e);
   }
  }
  </code></pre>
  <p>Getting following error
  <a href="https://i.stack.imgur.com/BCNAE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BCNAE.png" alt="enter image description here" /></a></p>