Refresh token JS

Hi Barry, if I should not do with this Ajax then what would be the optimal way using JS?

and i have no idea what this means “Your ajax call is wrong… you didn’t specify a post body.”