• 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: Open URL in Safari with Post params
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Open URL in Safari with Post params


  • Subject: Re: Open URL in Safari with Post params
  • From: Thomas Fischer <email@hidden>
  • Date: Fri, 11 Nov 2011 17:51:46 +0100

Hi Simon,

> On 11 Nov 2011, at 10:15, Thomas Fischer wrote:
>
>> I wouldn't know how to do this directly, but you can download a file and open it in Safari
>
> Hi Thomas
>
> Thanks for the reply but not what I'm after.

Are you sure?
The data is sent to the target, and the file you save is just the *reply* from that service.
Its only not Safari but "URL Access Scripting" which sends the data.
You just have to figure out how to encode the form data, I didn't check if URL Access Scripting does any encoding if special characters are involved.

> If a web page has a simple form asking for your name such that the source code for the form looked like:
>
> <form method="POST" action="/example.cgi">
> 	<input type=text name="birthyear">
> 	<input type=submit name="press" value=" OK ">
> </form>
>
> Using curl I could fake submitting data using the form by calling:
>
> curl --data "name=Thomas" http://www.example.com/example.cgi
>
> I'd like to do the same thing but using Safari.

In my case it was "URL Access Scripting", is there any particular need for it being Safari?
Actually, the result you get (the local file in your temp folder) may or may not work as you would want to, depending on different settings (e.g. cookies) and HTML styles (e.g. relative paths). But the latter could be dealt with.
I agree that it is not particularly elegant, though…

Best
Thomas _______________________________________________
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

  • Follow-Ups:
    • Re: Open URL in Safari with Post params
      • From: Simon Forster <email@hidden>
References: 
 >Open URL in Safari with Post params (From: Simon Forster <email@hidden>)
 >Re: Open URL in Safari with Post params (From: Emmanuel LEVY <email@hidden>)
 >Re: Open URL in Safari with Post params (From: Simon Forster <email@hidden>)
 >Re: Open URL in Safari with Post params (From: Thomas Fischer <email@hidden>)
 >Re: Open URL in Safari with Post params (From: Simon Forster <email@hidden>)

  • Prev by Date: Re: Add metadata to an existing QuickTime Movie
  • Next by Date: Re: Timeout when calling a library
  • Previous by thread: Re: Open URL in Safari with Post params
  • Next by thread: Re: Open URL in Safari with Post params
  • Index(es):
    • Date
    • Thread