title: How to set flutter POST method using DIO?
body: <p>This is my code below, i'm stuck please help. How to set flutter POST method using DIO?</p>
  
  <pre><code>Map&lt;String, dynamic&gt; toJson() {
      return {
          'id': id,
           "name": name,
           "telNumber": telNumber,
           "email": email,
           "age": age
        };
     }
  
  String postToJson(Post data){
        final dyn = data.toJson();
        return json.encode(dyn);
  }
  
  Future&lt;http.Response&gt; createPost(Post post) async {
            final response = await http.post(
                 "$baseUrl/users",
                headers: {
                    "content-type": "application"
                      },
                body: postToJson(post));
                return response;
              }
  </code></pre>
  
  <p>This method works in http</p>