Re: Tearing my bloody hair out.


EAS EDV-Analyse Sandro Sabatini
 

Hi Brian,

when I type "man curl“ in the terminal on my Mac then it reports:

       -G, --get
              When used, this option will make all data specified with -d, --data, --data-binary or --data-urlencode to be used in
              an HTTP GET request instead of the POST request that otherwise would be used. The data will be appended to  the  URL
              with a '?' separator.

              If used in combination with -I, --head, the POST data will instead be appended to the URL with a HEAD request.

              If  this option is used several times, only the first one is used. This is because undoing a GET doesn't make sense,
              but you should then instead enforce the alternative method you prefer.
so the option for using GET is not -H but -G.

Further, there is the following option for the user agent:

       -A, --user-agent <name>
              (HTTP) Specify the User-Agent string to send to the HTTP server. To encode blanks in the string, surround the string
              with single quote marks. This can also be set with the -H, --header option of course.

              If this option is used several times, the last one will be used.

I never used that, just a hint to use the man pages of curl.

Saba


Am 15.09.2017 um 07:51 schrieb Brian Christmas <ozsanta@...>:




G’day again scripters

I’ve been trying to study Curl for days, and now how to use Curl in a ‘do shell script’.

I can’t for the life of me see why this won’t work? BUT, I’m really a novice at using CURL, completely new to me.

Fast Springs site says I have to use GET. This handler returns “"

Santa

set jsonURL to do shell script "curl    -H  -u '2V57JR9HQNAZNZVOW6OZXG:F7l-9f3SR2We7q9L6mzds'   -G \"https://api.fastspring.com/subscriptions?limit=10000\”"


I’m trying to work out the correct syntax to get a subscription list from FastSpring, who I’m trying to set up to manage my subscritions for my APP.

I’ve contacted FastSprings support numerous times, but the most they’ll do regarding formatting scripts is ‘You’re on the right track’, or, unofficially, tell me to try ‘Postman’.

I’ve entered my credential into Postman, and it tells me there’s one text subscription, but every iteration of my Shell script returns “”, using the same credentials. I know I have to have a ‘User-Agent' header, but support won’t advise me if I’ve got the terminology correct. And my Googling shows there’s lots of ways to format a ‘User-Agent’ header!!! Postman uses it’s own method of addressing the FastSprings site.

I’m at a dead end! I’m told I have to use a ‘GET’, but read that the -H is  the ‘GET’ equivilent.

Any advice from anybody, please. I’m just guessing, and Googling is frustratingly un-informative.

If necessary, is there another company that makes this easier? I’ve battled with FastSpring support for over a week now. They absolutely refuse to supply or post examples. I need a pop-up store on my website, and a storefront for cancelling subscriptions.

Regards

Santa



set jsonURL to do shell script ("curl ' -H User-Agent:2V57JR9HQNAZNZVOW6OZXG/my-password-as-used-in-Postmanhttps://api.fastspring.com/subscriptions/limit=10000")



--- 
Sandro Sabatini, Senior Software Architect
EAS EDV-Analyse Sandro Sabatini, Klosbachstrasse 22, CH-8032 Zurich
Fon: +41 44 450 40 50, Fax: +41 44 450 40 54



Join applescript@apple-dev.groups.io to automatically receive all group messages.