@Wissam-Halimi should be:
JSON.stringify({"username": username}) without the space after "username"