Async Function Not Working

I’m messing around with the OpenStates API, and for whatever reason I cannot console.log my fetch request data within scriptable. I’ve tested the same code in JSAnywhere and it works fine, so I’m wondering if it’s just some Scriptable weirdness that I’m not understanding. Here is the code for reference:


async function requestData(request) {
		
	const response = await fetch(request, {
		method: 'GET',
		headers: {
		'Content-Type': 'application/json'	
		}
	});
	
	return response.json();
}

requestData(request)
.then(data => {
console.log(data)
});

There’s no error, just a blank console once It’s finished running. Any suggestions are greatly appreciated!

there’s no fetch in Scriptable. use Request.

1 Like

Oof. Thank you!! Sorry I never rtfm