Re: Open URL in Safari with Post params
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