0.1.1 • Published 2 years ago
@bundly/ares v0.1.1
Ares
HTTP client for calling REST APIs and seamlessly integrating Internet Identity with them.
NOTE: This is a Beta version
How to use
Basic usage
const response = await ares<TestResponse>({
  url: `${process.env.NEXT_PUBLIC_API_REST_URL}/test`,
  method: "POST",
  data: {
    message: "Hello, World!",
  },
  headers: {
    "Content-Type": "application/json",
  },
});Direct access to a method
const response = await ares.post<TestResponse>(
  `${process.env.NEXT_PUBLIC_API_REST_URL}/test`,
  {
    message: "Hello, World!",
  },
  {
    headers: {
      "Content-Type": "application/json",
    },
  }
);Create an instance
const instance = ares.create({
  baseURL: `${process.env.NEXT_PUBLIC_API_REST_URL}`,
});
const response = await instance.post<TestResponse>(
  "/test",
  {
    message: "Hello, World!",
  },
  {
    headers: {
      "Content-Type": "application/json",
    },
  }
);0.1.1
2 years ago
0.1.1-rc.1
2 years ago
0.1.1-rc.0
2 years ago
0.1.0
2 years ago
0.1.0-rc.1
2 years ago
0.1.0-rc.0
2 years ago