Haiku Problem Accessing JavaScript REST API w/ cURL

Will McQueen

New Member
I'm trying to turn on a flag using the REST API via cURL executed through AppleScript.  I'm having an issue getting cURL to call the URL of the HaikuHelper API successfully.  Turning on the verbose mode of cURL, I see that I'm getting a 401 HTTP response code back.  I'm passing the username and password in the URL, so I'm not sure what the issue is.  The exact same URL works in Chrome (and I don't get the HTTP Basic Auth Challenge).  I even tried setting the username/password using the --user flag, but that didn't work either.
 
I've worked around the issue for now by having AppleScript open Chrome and hit the URL, but it's kind of a hack and I'd rather use cURL if at all possible.
 
Any ideas?  I'm sure someone must be doing this already and I'm missing something silly.  :)
 
Thanks, Will
 
You have to add the --digest flag to enable digest authentication, ie.
Code:
curl -u controller_name:password --digest http://host:9399/api/controller
 
Back
Top