nl_tokens: Create set up and send an asynchronous request to the given path / URL with the given method and parameters .
pl_tokens: function _request ( path , method , headers , body , withCredentials , callback ) { const xhr = new XMLHttpRequest ( { } ) ; // Set up the event handlers. const handler = evt => { if ( callback ) { callback ( evt ) ; } // The request has been completed: detach all the handlers. xhr . removeEventListener ( 'error' , handler ) ; xhr . removeEventListener ( 'load' , handler ) ; } ; xhr . addEventListener ( 'error' , handler , false ) ; xhr . addEventListener ( 'load' , handler , false ) ; // Set up the request. xhr . open ( <mask> , path , true ) ; Object . keys ( headers || { } ) . forEach ( key => { xhr . setRequestHeader ( key , headers [ key ] ) ; } ) ; if ( withCredentials ) { xhr . withCredentials = withCredentials ; } xhr . send ( body || undefined ) ; return xhr ; }