Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

SSL Curl with Terminal vs Applescript

Hi folks,


I'm trying to access an HTTPS web site from Applescript. I'm hoping you can help:

- the website I want to access is: https://api.weather.gov/points/39.048,-774817

- I can get there with Applescript to Safari, but Safari automatically downloads the source and gives the downloaded file a weird name (difficult to work with). And, I don't want to go through Safari anyway

- I can get there with Terminal with the command: curl -k https://api.weather.gov/points/39.048,-774817

- the start of the correct result of the curl is:

{

"@context": [

- if I put this curl command in Applescript (do shell script "curl -k https://api.weather.gov/points/39.048,-774817"), I get:

"{

\"correlationId\": \"48422c52-0752-46d4-86de-a5cbf99bcedd\",

\"title\": \"Not Found\",

\"type\": \"https://api.weather.gov/problems/NotFound\",

\"status\": 404,

\"detail\": \"Not Found\",

\"instance\": \"https://api.weather.gov/requests/48422c52-0752-46d4-86de-a5cbf99bcedd\"

}"


Is this an SSL issue? I'd like to get this curl to work from Applescript... anyone know how to make this work?


Thanks

MacBook Pro (15-inch Early 2011)

Posted on Mar 11, 2018 5:49 PM

Reply
Question marked as Best reply

Posted on Mar 11, 2018 6:06 PM

It looks like a typo. You need a decimal point in your longitude value. And you can omit the "-k" part.

2 replies

SSL Curl with Terminal vs Applescript

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.