I am trying to do a simple post request from a flutter app to a firebase database. This is my code:
child: RaisedButton(
child:Text('A firebase'),
textColor: Colors.blueGrey,
onPressed: () {
var url = "https://gip-reports.firebaseio.com/reporte.json";
http.post(url, body: {"name": "doodle", "color": "blue"})
.then((response) {
print("Response status: ${response.statusCode}");
print("Response body: ${response.body}");
});
},
),
The problem is, when I use this code, the cmd shows this error:
I/flutter (16602): Response status: 401
I/flutter (16602): Response body: {
I/flutter (16602): "error" : "Permission denied"
I/flutter (16602): }
How can I get my app to post to firebase?