function handleBody(response, { method } = {}) {
	if (response.status === HTTP_STATUS.NO_CONTENT || method === HTTP_METHODS.HEAD) {
		return Promise.resolve({
			data: '',
			response,
		});
	}

	let methodBody = 'text';

	const headers = get(response, 'headers', new Headers());
	const contentType = headers.get('Content-Type');
	if (contentType && contentType.includes('application/json')) {
		methodBody = 'json';
	}

	if (contentType && contentType.includes('application/zip')) {
		methodBody = 'blob';
	}

	return response[methodBody]().then(data => ({ data, response }));
}
/**
 * handleHttpResponse - handle the http body
 *
 * @param  {Response} response A response object
 * @return {Promise}           A promise that resolves with the result of parsing the body
 */
handle the http body
@param  {Response} response A response object
@return {Promise}           A promise that resolves with the result of parsing the body
handle the http body @param { Response } response A response object @return { Promise } A promise that resolves with the result of parsing the body
function handleBody(response, { method } = {}) {
	if (response.status === HTTP_STATUS.NO_CONTENT || method === HTTP_METHODS.HEAD) {
		return Promise.resolve({
			data: '',
			response,
		});
	}
	let methodBody = 'text';
	const headers = get(response, 'headers', new Headers());
	const contentType = headers.get('Content-Type');
	if (contentType && contentType.includes('application/json')) {
		methodBody = 'json';
	}
	if (contentType && contentType.includes('application/zip')) {
		methodBody = 'blob';
	}
	return response[methodBody]().then(data => ({ data, response }));
}
function handleBody ( response , { method } = { } ) { if ( response . status === HTTP_STATUS . NO_CONTENT || method === HTTP_METHODS . HEAD ) { return Promise . resolve ( { data : '' , response , } ) ; } let methodBody = 'text' ; const headers = get ( response , 'headers' , new Headers ( ) ) ; const contentType = headers . get ( 'Content-Type' ) ; if ( contentType && contentType . includes ( 'application/json' ) ) { methodBody = 'json' ; } if ( contentType && contentType . includes ( 'application/zip' ) ) { methodBody = 'blob' ; } return response [ methodBody ] ( ) . then ( data => ( { data , response } ) ) ; }
handleHttpResponse - handle the http body
 @param  {Response} response A response object
 @return {Promise}           A promise that resolves with the result of parsing the body
handleHttpResponse - handle the http body @param { Response } response A response object @return { Promise } A promise that resolves with the result of parsing the body