Curl from shell
Richard Gaskin
ambassador at fourthworld.com
Fri Aug 14 18:15:14 EDT 2015
Marty Knapp wrote:
> I'm trying to call curl from a shell command from within LC to get info
> from a website via their API and am getting a "could not resolve host"
> error. I can successfully run curl from the terminal (on Mac). This is
> totally new territory for me, so I have almost no idea of what I'm
> doing! I'm using LC 6.6.5 if that makes any difference.
>
> Here's the curl statement I'm using (formatted per the website's API):
>
> curl -H "Accept: text/xml"
> https://API_KEY:API_SECRET@www.thewebsite.com/api/v1/data
>
> Works fine in Terminal. Note that it is using https if that matters.
If it works in Terminal I'm mystified; Mark Wieder may have a tip for that.
Have you tested it with libURL? For HTTP/HTTPS it shouldn't be
necessary to use curl or other outside programs.
FWIW, I did some testing with wget yesterday (not the same as curl, but
often considered a bit lighter), and I found that the overhead of
instantiating the terminal session with shell meant that using libURL
was about 20% faster overall for downloading a 1MB binary data file.
--
Richard Gaskin
Fourth World Systems
Software Design and Development for the Desktop, Mobile, and the Web
____________________________________________________________________
Ambassador at FourthWorld.com http://www.FourthWorld.com
More information about the use-livecode
mailing list