src/utilities/http.js
function POST(uri, params) {
	var form = new FormData();

	for (var i in params) {
		form.append(i, params[i]);
	}

	const requestURL = `${uri}`;
	log(`request URL: ${requestURL}`);

	return fetch(requestURL, { method: 'POST', compress: compress, body: form, headers: { 'Content-Type': 'multipart/form-data; boundary='+form.getBoundary() } })
    .then(function handleRequest(res) {
			const status = res.status;
			if (status != 200) {
				const error = new Error(`Request failed: ${status}`);
				error.status = status;
				throw error;
			}
			return res.json();
		})
		.catch(error => {
			log(`error: ${error}`);
			throw error;
		});
}
function POST(uri, params) {
	var form = new FormData();

	for (var i in params) {
		form.append(i, params[i]);
	}

	const requestURL = `${uri}`;
	log(`request URL: ${requestURL}`);

	return fetch(requestURL, { method: 'POST', compress: compress, body: form, headers: { 'Content-Type': 'multipart/form-data; boundary='+form.getBoundary() } })
    .then(function handleRequest(res) {
			const status = res.status;
			if (status != 200) {
				const error = new Error(`Request failed: ${status}`);
				error.status = status;
				throw error;
			}
			return res.json();
		})
		.catch(error => {
			log(`error: ${error}`);
			throw error;
		});
}
function POST ( uri , params ) { var form = new FormData ( ) ; for ( var i in params ) { form . append ( i , params [ i ] ) ; } const requestURL = ` ${ uri } ` ; log ( ` ${ requestURL } ` ) ; return fetch ( requestURL , { method : 'POST' , compress : compress , body : form , headers : { 'Content-Type' : 'multipart/form-data; boundary=' + form . getBoundary ( ) } } ) . then ( function handleRequest ( res ) { const status = res . status ; if ( status != 200 ) { const error = new Error ( ` ${ status } ` ) ; error . status = status ; throw error ; } return res . json ( ) ; } ) . catch ( error => { log ( ` ${ error } ` ) ; throw error ; } ) ; }
Use this functions for HTTP POST request

@param {String} uri    - request URL
@param {Object} params - request parameters
@return {Promise}  HTTP response
Use this functions for HTTP POST request