Skip to content
Advertisement

http.post is not working /sending null value in Flutter

The HTTP.POST method is not sending any variable back to the php script – I checked it using isset()

Code:

JavaScript

Beyond this is all UI and when I use debugPrint(s) – it prints the value

Advertisement

Answer

If you already checked up that the service is working, just add the headers in your request to indicate that you are using a json in your body and encode your map as json, try the follow:

JavaScript

Hope it helps, for more info please check the section Send data to the internet in the Flutter documentation.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement