I\'d like to know if Google Chrome Extension can make a HTTP request and parse the body of the result (like Curl). For example, there is a server 1.2.3.4 that answers the q
Yes, using Cross-Origin XMLHttpRequest. Set the permissions in the manifest and use it like
var xhr = new XMLHttpRequest();
xhr.open("GET", "http://api.example.com/data.json", true);
xhr.onreadystatechange = function() {
if (xhr.readyState == 4) {
// WARNING! Might be injecting a malicious script!
document.getElementById("resp").innerHTML = xhr.responseText;
...
}
}
xhr.send();