POST payload to rails model t.json 'payload'

So guys i’m working on a tournament bracket based on the GOjs library, The bracket has score input. Once my user is done editing the bracket i save the bracket into a json variable :

function save() {
    var tojs = myDiagram.model.toJSON();
    var payload = JSON.parse(tojs);
    stringify_tojs = JSON.stringify(payload);
    myDiagram.isModified = false;

I use XMLHttpRequest to able to post the payload into my rails model that handles ‘payload’ :

var request = new XMLHttpRequest();
    request.onload = callback;"post", "http://localhost:3000/malesingles");
    request.setRequestHeader("Content-Type", "application/json");

I dont know where i went wrong but i’m certain it’s around my controller params but i can’t find my mistake already been a week, the controller looks something like this :

@tournoi =
    redirect_to root_url
flash[:success] = "Your tournament bracket has been validated!"
  #  redirect_to @  tournoi
    render 'new'

end i have included the bracket_params in private settings

      def bracket_params

Tried different method to post the payload none really work, would appreciate some help to understand where i went wrong, i get a param is missing or empty :/.

What is actually arriving as the raw params -- are you inspecting it
via logging statements or pry or ??

Have you tried submitting a properly-shaped payload via e.g. curl
or wget to confirm your controller action is handling it correctly?