Posting data to web api

Hi there,
I am trying to send data to a web api, the htm/javascript test page I run via a browser works fine and the data is added to the database but when I try in flutter/dart I get 500 error. below is my javascript/jquery code and also dart code.

How do I get my flutter app to post the data successfully?

Thanks in advance
Jamie

JAVASCRIPT

<script>
$.post( "/users/createUser.php", {"authtoken":"b92f3674f-7ab6-49c4-93fa-c078abd30464", "tt":"Mr", "fn":"John", "mn":"Joe", "ln":"Bloggs","dob":"1923-10-14", "tp":"01555821479", "oc":"09384747474", "hn":"123", "st":"Street lane", "to":"Mytown", "co":"MyCounty", "pc":"QW23 2WE", "un":"myUsername", "pw":"MyPassword", "ut":"1", "ge":"male", "ea":"myemail@testdomain.local" },
function(response) {
  console.log(response)
});
</script>

FLUTTER/DART

Future<http.Response> save() async {
String url = 'http://api.mydomain.com/users/createUser.php';

var body = json.encode({"authtoken":"b92f3674f-7ab6-49c4-93fa-c078abd30464", "tt":"Mr", "fn":"John", "mn":"Joe", "ln":"Bloggs","dob":"1923-10-14", "tp":"01555821479", "oc":"09384747474", "hn":"123", "st":"Street lane", "to":"Mytown", "co":"MyCounty", "pc":"QW23 2WE", "un":"myUsername", "pw":"MyPassword", "ut":"1", "ge":"male", "ea":"myemail@testdomain.local" });
    Map<String,String> headers = {
      'Content-type' : 'application/json', 
      'Accept': 'application/json',
    };
    final response =
        await http.post(url, body: body, headers: headers);
print('Response status: ${response.statusCode}');
print('Response body: ${response.body}');
final responseJson = json.decode(response.body);
return (response);
}