Flutter is not posting my question to the API

when we send data to server in mobile mostly is the raw format. for that we have to use 'jsonEncode' for converting and we have to set header.

   postData() async {
     print('entered postDAta');
       var response = await http.post(
       Uri.parse("http://localhost:8080/api/auth/signup"),
      body: jsonEncode({
       "username": "flota",
       "email": "[email protected]",
      "password": "87654321",
      }),headers: {
      'Content-type': 'application/json',
      'Accept': 'application/json',
    }
   );
   print(response.body);
    print('exited postdata');
      }