nl_tokens: request
pl_tokens: async function request ( url , options ) { if ( ! options ) { if ( isPlainObject ( url ) ) { options = url url = null } else { options = { url } } } if ( ! isPlainObject ( options ) ) { throw new ParameterException ( 'Options must be an object!' ) } if ( isString ( url ) ) { options . url = url } if ( ! isString ( options . url ) ) { throw new ParameterException ( 'URL is required!' ) } let { interceptors , ... req } = options interceptors = intercept ( interceptors ) req = await parseReq ( req ) req = await iterateInterceptors ( req , interceptors . request ) const res = await fetch ( req . url , req ) let body = await getBody ( res ) body = await iterateInterceptors ( body , interceptors . response ) if ( <mask> . status >= 200 && res . status < 400 ) { return body } throw body }