httpi

A HTTP client

Usage no npm install needed!

<script type="module">
  import httpi from 'https://cdn.skypack.dev/httpi';
</script>

README

httpi

Example:

const http = new HttpClient({
  baseUrl: "http://localhost",
  headers: {
    "Authorization": "Bearer 1234"
  }
});

http.interceptors.push({
  response: (res) => {
    return res;
  },
  responseError: (res) => {
    return res;
  }
});

http.post("/hello").then(() => {
  done();
});