I am having no luck trying to figure out how to make an api call to snaps_find with the v2 api. The following gives me a bad request response, any suggestions?
async function snapcraft_find(str) {
let response = await fetch("https://api.snapcraft.io/v2/snaps/find?q=" + str + "&fields=package_name,media", {
mode: "no-cors",
method: "GET",
headers: {
"Snap-Device-Series": "16"
}
});
result = await response.text();
alert(result);
}