I’m trying to use Hazel to “POST” to a URL using one custom input variable. I normally have good luck with ChatGPT but it’s not working. Neither is Gemini.
Any help would be appreciated. It’s straight forward with just doing a POST request to “https://myurl.com?customVarible=variable”
Nothing else needed
Couldn’t you have a Hazel rule that runs a script to do it? Here is a bash script that ChatGPT suggests:
#!/bin/bash
URL=“https://example.com/your-endpoint”
INPUT_VAR_NAME=“your_variable_name”
INPUT_VAR_VALUE=“your_value”
curl -X POST “$URL”
-H “Content-Type: application/x-www-form-urlencoded”
-d “$INPUT_VAR_NAME=$INPUT_VAR_VALUE”
Seems simple enough.
2 Likes
thanks for the help! I don’t see how to bring in the variable that I created matching a part of file name. I want to bring in the “schoolID” from the Name match. It just says $1 for file.
This did work! I can’t figure out the schoolID part, but I’m just passing along the $1 for the filename and I can get what I need on the other side!
1 Like