Jump to content

POST request in JS Script


Recommended Posts

Hi,

 

I try to make a POST request in a "Run Script" Action using JS. I tried doing it with fetch() or an XMLHttpRequest but I get errors stating XMLHttpRequest and fetch are undefined variables. I think there's something I don't get about scripting yet and how they work and what we have access to. Hopefully somebody can enlighten me.

 

cheers

Link to comment

JS is a special case. A lot of the functions you’re used to using are properties of the browser environment. They don’t exist when the script is running in Alfred.

 

I’d suggest using a language that does have HTTP libraries (Ruby, Python etc.) or using the curl command.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...