JSFiddle - React, Tailwind, and code Playground

by WILLIAM CORREA

JavaScript

var data = new FormData();
data.append("client_id" );
data.append("client_secret");
data.append("grant_type");
data.append("username");
data.append("password");

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://pos-api.ifood.com.br/oauth/token");

xhr.send(data);