I would use curl in
do shell script "#curl script here"
If you need help getting the correct curl statement, I recommend postman , it helps me generate the correct code. But remember, if you have: "to put the escape-character front: \".
So, for example, if I want to make a POST request for
https:
AppleScript will look like this:
do shell script "curl -X POST -H \"Cache-Control: no-cache\" \"https://api.widerstandsberechner.ch/api.php?firstcolor=red&secondcolor=orange&thirdcolor=yellow&fourthcolor=silver&hasFiveRings=0&resultInText=0\""
And of course, you can easily assign the result as a value:
set res to do shell script "curl -X POST -H \"Cache-Control: no-cache\" \"https://api.widerstandsberechner.ch/api.php?firstcolor=red&secondcolor=orange&thirdcolor=yellow&fourthcolor=silver&hasFiveRings=0&resultInText=0\""
Hope this helps!
source
share