let user = {
    "username" : "ametsene",
    "password" : "amet123",
    "gender" : "male",
    "email": "amet@gmail.com"
}

fetch ("script.php", {
    "method": "POST",
    "headers": {
        "content-type": "application/json; charset=utf-8"
    },
    "body": JSON.stringify(user)
}).then(function (response) {
    return response.json();
}).then (function($data) {
    console.log($data);
})

const xhttp = new XMLHttpRequest();
