api/http/builders/EndpointBuilder.js
/**
		 * Adds a {@link ResponseInterceptor} for successful web service responses.
		 *
		 * @public
		 * @param {ResponseInterceptor} responseInterceptor
		 * @returns {EndpointBuilder}
		 */
Adds a  ResponseInterceptor for successful web service responses.
Adds a ResponseInterceptor for successful web service responses .
withResponseInterceptor(responseInterceptor) {
			assert.argumentIsRequired(responseInterceptor, 'responseInterceptor', ResponseInterceptor, 'ResponseInterceptor');
			let existingResponseInterceptor = this.endpoint.responseInterceptor;
			let updatedResponseInterceptor;
			if (existingResponseInterceptor && existingResponseInterceptor !== ResponseInterceptor.EMPTY) {
				updatedResponseInterceptor = new CompositeResponseInterceptor(existingResponseInterceptor, responseInterceptor);
			} else {
				updatedResponseInterceptor = responseInterceptor;
			}
			this._endpoint = new Endpoint(this.endpoint.name, this.endpoint.description, this.endpoint.verb, this.endpoint.protocol, this.endpoint.host, this.endpoint.port, this.endpoint.path, this.endpoint.query, this.endpoint.headers, this.endpoint.body, this.endpoint.credentials, this.endpoint.requestInterceptor, updatedResponseInterceptor, this.endpoint.errorInterceptor);
			return this;
		}
withResponseInterceptor ( responseInterceptor ) { assert . argumentIsRequired ( responseInterceptor , 'responseInterceptor' , ResponseInterceptor , 'ResponseInterceptor' ) ; let existingResponseInterceptor = this . endpoint . responseInterceptor ; let updatedResponseInterceptor ; if ( existingResponseInterceptor && existingResponseInterceptor !== ResponseInterceptor . EMPTY ) { updatedResponseInterceptor = new CompositeResponseInterceptor ( existingResponseInterceptor , responseInterceptor ) ; } else { updatedResponseInterceptor = responseInterceptor ; } this . _endpoint = new Endpoint ( this . endpoint . name , this . endpoint . description , this . endpoint . verb , this . endpoint . protocol , this . endpoint . host , this . endpoint . port , this . endpoint . path , this . endpoint . query , this . endpoint . headers , this . endpoint . body , this . endpoint . credentials , this . endpoint . requestInterceptor , updatedResponseInterceptor , this . endpoint . errorInterceptor ) ; return this ; }
Adds a {@link ResponseInterceptor} for successful web service responses.
Adds a { @link ResponseInterceptor } for successful web service responses .