nl_tokens: wrap request
pl_tokens: function nosRequest ( { method , uri , body = '' , headers = { } } ) { return new Promise ( ( resolve , reject ) => { request ( { method , uri , body , headers } , function ( err , response , body ) { if ( err ) { return reject ( err ) ; } if ( response . statusCode >= 400 ) { parseString ( body ) . then ( ( { Error } ) => { let e = { code : Error . Code . join ( '' ) , message : Error . Message . join ( '' ) } ; reject ( e ) ; } ) . catch ( reject ) ; } else if ( body ) { if ( typeof body === 'string' && response . headers [ 'content-type' ] . toLowerCase ( ) === XML_MINE ) { parseString ( body ) . then ( json => { resolve ( json ) ; } ) . catch ( reject ) ; } else { resolve ( assign ( { body : body , url : headers . url } ) ) ; } } else { let ret = pick ( response . headers , [ 'content-type' , 'x-nos-request-id' , 'etag' , 'content-range' , 'last-modified' , 'content-length' ] ) ; assign ( ret , { url : headers . <mask> } ) ; resolve ( ret ) ; } } ) ; } ) }