Skip to main content

How to Make HTTP Requests?

To make HTTP requests with the visualizer, please use fetch, as in the following example:

fetch("https://api.github.com/repos/" + id, {
method: "GET",
cache: "no-cache",
headers: {
Accept: "application/vnd.github.v3+json",
Authorization: token,
},
})
.then((response) => response.json())
.then((result) => {
console.log("Success:", result);
})
.catch((error) => {
console.error("Error:", error);
});