[lib.client.xhr] added DEBUG mode

This commit is contained in:
xdrm-brackets 2018-03-27 13:58:26 +02:00
parent bb0bfb5065
commit 97617181b9
1 changed files with 7 additions and 1 deletions

View File

@ -2,6 +2,8 @@ import ClientDriver from './client-driver.js'
export default class XHRClientDriver extends ClientDriver{
static get DEBUG(){ return true; }
/* (1) Creates a client driver
*
@ -158,9 +160,13 @@ export default class XHRClientDriver extends ClientDriver{
/* (3) Open connection */
this.xhr.open(http_method, `${protocol}${request_uri}`, true);
/* (3) Send request */
/* (4) Send request */
this.xhr.send(form_data);
/* (5) DEBUG */
( XHRClientDriver.DEBUG ) && console.log(`XHRClientDriver(url '${protocol}${request_uri}', form '`, form_data, `'`);
return true;
}