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
2 replies

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

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 Account.