@hke/http

Small and easy HTTP request wrapper

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@hke/http
0.2.75 years ago6 years agoMinified + gzip package size for @hke/http in KB

Readme

HttpService.buildUrl(url: string, query: any = {})
  • Transforms a url plus an object to a callable url
@param {string} url A url @param {object} query An object with key value pairs which will be transformed to get parameters @returns {string}
HttpService.post(url: string, body?: any, query?: any)
  • Does a POST request
@param {string} url An url @param {object} body The POST payload object @param {object} query An object with key value pairs which will be transformed to get parameters @returns {Promise}
HttpService.get(url: string, query?: any)
  • Does a GET request
@param {string} url An url @param {object} query An object with key value pairs which will be transformed to get parameters @returns {Promise}
HttpService.put(url: string, body: any, query?: any)
  • Does a PUT request
@param {string} url An url @param {object} body The PUT payload object @param {object} query An object with key value pairs which will be transformed to get parameters @returns {Promise}
HttpService.delete(url: string, query?: any)
  • Does a DELETE request
@param {string} url An url @param {object} query An object with key value pairs which will be transformed to get parameters @returns {Promise}
HttpService.file(url: string, files: File[], query?: any)
  • Uploads a file
@param {string} url An url @param files @param {object} query An object with key value pairs which will be transformed to get parameters @returns {Promise}