title: DioError [DioErrorType.response] Http status error [404] - flutter
body: <pre><code> DioError [DioErrorType.response] Http status error [404] - flutter 
  </code></pre>
  <p>I'm creating a forget password screen for my app. I want to display &quot;email sent&quot; message when I click &quot;Reset password &quot; button.. instead of that ,I'm getting above error when I'm enter already registered  email address. postman request is successfully working. how to solve this issue. appreciate your help on this.</p>
  <p><a href="https://i.stack.imgur.com/j9vep.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/j9vep.png" alt="postman response" /></a></p>
  <pre><code>   import 'package:dio/dio.dart';
  import 'package:doctor_app/constants/Button.dart';
  import 'package:flutter/cupertino.dart';
  import 'package:flutter/material.dart';
  import 'package:flutter/services.dart';
  import 'package:get/get.dart';
  import 'package:get/get_core/src/get_main.dart';
  
  import '../constants/colors.dart';
  
  class ForgetPassword extends StatelessWidget {
    const ForgetPassword({Key? key}) : super(key: key);
  
    @override
    Widget build(BuildContext context) {
      SystemChrome.setEnabledSystemUIMode(SystemUiMode.leanBack);
      return Scaffold(
        resizeToAvoidBottomInset: false,
        body: Padding(
          padding: const EdgeInsets.all(20.0),
          child: Column(
            children: [
              Row(
                mainAxisAlignment: MainAxisAlignment.start,
                children: [
                  SizedBox(
                    height: 20,
                  ),
                  Text('DOCTOR',
                      style: TextStyle(
                        fontFamily: 'Dubai',
                        fontSize: 30,
                        color: Color(0xff05ABA3),
                        fontWeight: FontWeight.w500,
                      )),
                ],
              ),
              Spacer(
                flex: 1,
              ),
              Row(mainAxisAlignment: MainAxisAlignment.start, children: [
                Text('Forgot your password?',
                    style: TextStyle(
                      height: 1.2,
                      fontFamily: 'Dubai',
                      fontSize: 25,
                      color: Color(0xff040000),
                      fontWeight: FontWeight.w500,
                    )),
              ]),
              Spacer(
                flex: 1,
              ),
              Column(
                mainAxisAlignment: MainAxisAlignment.center,
                crossAxisAlignment: CrossAxisAlignment.center,
                children: [
                  Text('Confirm your email and we will send the Instructions ',
                      style: TextStyle(
                        height: 1.2,
                        fontFamily: 'Dubai',
                        fontSize: 18,
                        color: Color(0xff707070),
                        fontWeight: FontWeight.w100,
                      )),
                ],
              ),
              Spacer(
                flex: 1,
              ),
  
              ForgetPasswordForm(), //email
              Spacer(
                flex: 1,
              ),
              Row(
                mainAxisAlignment: MainAxisAlignment.center,
                children: [
                  Text(
                    'didnt receive an email?',
                    style: TextStyle(
                      height: 1.2,
                      fontFamily: 'Dubai',
                      fontSize: 13,
                      color: Colors.grey,
                      fontWeight: FontWeight.w500,
                    ),
                  ),
                  SizedBox(
                    width: 5,
                  ),
                  Align(
                      alignment: Alignment.bottomLeft,
                      child: InkWell(
                          onTap: () {
                            // add action here whatever you want.
                          },
                          child: Text('send again  ',
                              style: TextStyle(
                                height: 1.2,
                                fontFamily: 'Dubai',
                                fontSize: 13,
                                color: Colors.blue,
                                fontWeight: FontWeight.w500,
                              ))))
                ],
              ),
              Spacer(
                flex: 1,
              ),
  
              Row(
                mainAxisAlignment: MainAxisAlignment.center,
                children: [
                  Container(
                    decoration: BoxDecoration(
                      borderRadius: BorderRadius.circular(5.0),
                      color: Color(0xff05ABA3),
                    ),
                    height: 5,
                    width: 120,
                  ),
                ],
              ),
            ],
          ),
        ),
      );
    }
  }
  
  class ForgetPasswordForm extends StatefulWidget {
    const ForgetPasswordForm({Key? key}) : super(key: key);
  
    @override
    _ForgetPasswordFormState createState() =&gt; _ForgetPasswordFormState();
  }
  
  class _ForgetPasswordFormState extends State&lt;ForgetPasswordForm&gt; {
    final _formKey = GlobalKey&lt;FormState&gt;();
  
    //String _userName = &quot;&quot;;
    String email = &quot;&quot;;
  
    Future Resetpassword() async {
      try {
        var response = await Dio().post(
            'https://doctor-app2-hit.herokuapp.com/user/forgotpassword',
            data: {
              &quot;email&quot;: email,
            });
  
        if (response.data[&quot;data&quot;] ==
            &quot;Please check your email to reset password.&quot;) {
          Get.snackbar(&quot;success&quot;, &quot;Email Sent Successfully!&quot;);
          //Get.to(VideoScreen());
  
        }else{
          Get.snackbar(&quot;error&quot;, &quot;No User Found&quot;);
        }
        print(&quot;res: $response&quot;);
      } catch (e) {
  
        Get.snackbar(&quot;error&quot;, &quot;Server Error&quot;);
        print(e);
      }
    }
  
    @override
    Widget build(BuildContext context) {
      return SingleChildScrollView(
          child: Form(
              child: Container(
                  key: _formKey,
                  child: Container(
                      child: Padding(
                    padding: const EdgeInsets.all(30.0),
                    child: Column(children: [
                      TextFormField(
                          keyboardType: TextInputType.emailAddress,
                          decoration: const InputDecoration(
                              hintText: &quot;Email&quot;,
                              hintStyle: TextStyle(
                                  color: textGrey,
                                  fontFamily: &quot;Dubai&quot;,
                                  fontSize: 14)),
                          validator: (String? Email) {
                            if (Email != null &amp;&amp; Email.isEmpty) {
                              return &quot;Email can't be empty&quot;;
                            }
                            return null;
                          }),
                      SizedBox(
                        height: 50,
                      ),
                      Container(
                        child: GestureDetector(
                          child: ButtonM(&quot;Reset Password&quot;),
                          onTap: () async {
                            Resetpassword();
                          },
                        ),
                      )
                    ]),
                  )))));
    }
  }
  </code></pre>