title: How to post data in React Native?
body: <p>I have written this code to post data in the url but is not working, this is my Json file </p>
  
  <pre><code>[{
          "id": 9,
          "questionnairename": "sfdsdf",
          "created_at": null,
          "updated_at": null,
          "questionnairecontent": null,
          "answername": null,
          "mosha": null,
          "gjinia": null,
          "komuna": null,
          "emri": null,
          "email": null,
          "importanttopics": null,
          "selectedparties": null,
          "session": null
      }, {
          "id": 10,
          "questionnairename": null,
          "created_at": null,
          "updated_at": null,
          "questionnairecontent": null,
          "answername": null,
          "mosha": null,
          "gjinia": null,
          "komuna": null,
          "emri": null,
          "email": null,
          "importanttopics": null,
          "selectedparties": null,
          "session": null
      },
  </code></pre>
  
  <p>This is my code:</p>
  
  <pre><code>import { FlatList, StyleSheet, Text, View ,Button} from "react-native";
  
  export default class App extends Component {
    state = {
      // data: [],
      text:"",
      questionnairename:""
  
    };
  
    postData=async()=&gt;{
      let anketaData = new anketaData();
      anketaData.append("id","0");
      anketaData.append("questionnairename","ermira");
  
      this.setState({text:"ermira"})
      fetch("http://192.168.0.100:8000/anketa/testd?method=get",{
        method:"POST",
        body:anketaData
      }).then((response)=&gt;response())
      .then((responseJson)=&gt;{
        this.setState({text:JSON.stringify(responseJson)})
      })
    }
  
    render() {
      return (
        &lt;View style={styles.container}&gt;
          &lt;Button onPress={this.postData} title="Post data"&gt;&lt;/Button&gt;
          &lt;Text&gt;{this.state.text}&lt;/Text&gt;
          &lt;FlatList
            data={this.state.data}
            keyExtractor={(x, i) =&gt; i}
            renderItem={({ item }) =&gt;
              &lt;Text&gt;
                {item.questionnairename} 
              &lt;/Text&gt;}
          /&gt;
        &lt;/View&gt;
      );
    }
  }
  
  const styles = StyleSheet.create({
    container: {
      marginTop: 15,
      flex: 1,
      justifyContent: "center",
      alignItems: "center",
      backgroundColor: "#F5FCFF"
    }
  });
  </code></pre>
  
  <p>This is the error:</p>
  
  <blockquote>
    <p>"Possible Unhandled Promise Rejection (id:0)":
    TypeError: undefined is not a contructor(evaluating "new anketaData()")</p>
  </blockquote>