• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: do shell script, curl and cookies
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: do shell script, curl and cookies


  • Subject: Re: do shell script, curl and cookies
  • From: Håvard Graudo <email@hidden>
  • Date: Fri, 12 Apr 2013 08:53:50 +0200

Setting the complete path works!

do shell script "curl --cookie-jar /Users/Shared/zecookie.txt 'http://...
do shell script "curl --cookie /Users/Shared/zecookie.txt http://...

Thank you, Dough, Jim and Axel!

Håvard




Den 11. apr. 2013 kl. 23.02 skrev Jim Skibbie:

> That looks right to me, but maybe you should flesh out a known path to your cookie, just to confirm it is writing something and it where and what you expect:
>
>
> do shell script "curl --cookie-jar ~/Desktop/testcookie 'http://www.example.com/login?username=bob&password=pass'"
> do shell script "curl --cookie ~/Desktop/testcookie 'http://www.example.com/search?q=something'"
>
>
> You might want to also look at the HTTP request to make sure you aren't getting redirected as part of the request. You may need to put a –L flag in your second curl command so that it follows the redirect.
>
> Jim
>
>
>> Date: Thu, 11 Apr 2013 16:14:57 +0200
>> From: Håvard Graudo
>>
>> I have problems using cookies with curl via do shell script.
>>
>> I want to login and get a cookie, then send commands back to the server, including the cookie.
>>
>> This works in Terminal:
>> curl --cookie-jar zecookie.txt 'http://www.example.com/login?username=bob&password=pass'
>> --> login OK, sessionID: 1i7nm0ch6pphezdqkulhdub30 blah blah
>> curl --cookie zecookie.txt  'http://www.example.com/search?q=something'
>> --> returns my search. all nice and dandy
>>
>> The information stored in the cookie is a plain Netscape HTTP Cookie File.
>>
>> However if I do the SAME THING using 'do shell script' it fails:
>> do shell script "curl --cookie-jar zecookie.txt 'http://www.example.com/login?username=bob&password=pass'"
>> --> login OK, sessionID: s04988pspn6otuaaz6xeuooy blah blah
>> do shell script "curl --cookie zecookie.txt  'http://www.example.com/search?q=ssomething'"
>> -- NOT LOGGED IN
>>
>> What works in Terminal does not with 'do shell script'.
>>
>> Can someone help me in the right direction here?
>>
>> Thank you
>>
>> Håvard
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> AppleScript-Users mailing list      (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> Archives: http://lists.apple.com/archives/applescript-users
>
> This email sent to email@hidden



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden


References: 
 >Re: do shell script, curl and cookies (From: Jim Skibbie <email@hidden>)

  • Prev by Date: Re: do shell script, curl and cookies
  • Next by Date: Re: duplicate command
  • Previous by thread: Re: do shell script, curl and cookies
  • Next by thread: Re: do shell script, curl and cookies
  • Index(es):
    • Date
    • Thread