I want to do an HTTP POST from inside an iMacro to an API endpoint. Effectively, something like the following:
curl -d \"data=foo\" http://examp
You can use http://wiki.imacros.net/iMacros_for_Firefox with javascript and jquery. Then it's easy with any form, get and post request thing.
Small javascript example with jquery and imacros for firefox:
function loadScriptFromURL(url) {
var request = Components.classes['@mozilla.org/xmlextras/xmlhttprequest;1'].createInstance(Components.interfaces.nsIXMLHttpRequest),
async = false;
request.open('GET', url, async);
request.send();
if (request.status !== 200) {
var message = 'an error occurred while loading script at url: ' + url + ', status: ' + request.status;
iimDisplay(message);
return false;
}
eval(request.response);
return true;
}
loadScriptFromURL('https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js');
$ = window.$,
JQuery = window.JQuery;