• 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: Post Data - CAN use POST method
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Post Data - CAN use POST method


  • Subject: Re: Post Data - CAN use POST method
  • From: "Daniel A. Shockley" <email@hidden>
  • Date: Wed, 2 Jan 2002 13:45:39 -0500

From: "C. K. C." <email@hidden>
To: <email@hidden>
Subject: Post Data
Date: Sat, 29 Dec 2001 20:26:00 +0800

I would like to know how to send form data through AppleScript.
Can anyone just provide an example?
It would really help.

As you can see below, the form data is NOT in the URL, it is sent as encoded POST data. URL Access Scripting can handle any form you can fill out on the web, unless they deliberately try to avoid this by requiring a user to choose to click on a randomly-changed image to select input (which PayPal does to avoid automated credit-card fraud).

URL Access Scripting can do almost anything you can do with a web browser.

------------ BEGIN SCRIPT
tell application "URL Access Scripting"
-- the URL below is the 'action' of a form on the page: http://www.comp.leeds.ac.uk/Perl/Cgi/textareas.html
activate
download "http://www.comp.leeds.ac.uk/cgi-bin/Perl/environment-example"; to file ,
"Minx:Users:krioni:Desktop:newfile.html" form data ,
"review=Here+is+my+text" replacing yes with progress
end tell
------------ END SCRIPT

Running that returns the following (notice that the form data is correctly not shown below, as it was POSTed, not GETted):

Here are the environment variables that this CGI script has been called with.
------------------------------------------------------------------------
SERVER_SOFTWARE = Apache/1.3.17 (Unix) mod_perl/1.25 PHP/4.0.4pl1
SERVER_NAME = www.comp.leeds.ac.uk
GATEWAY_INTERFACE = CGI/1.1
SERVER_PROTOCOL = HTTP/1.0
SERVER_PORT = 80
REQUEST_METHOD = POST
HTTP_ACCEPT = ''
PATH_INFO =
PATH_TRANSLATED =
SCRIPT_NAME = /cgi-bin/Perl/environment-example
QUERY_STRING =
REMOTE_HOST =
REMOTE_ADDR = 207.106.222.66
REMOTE_USER =
CONTENT_TYPE = application/x-www-form-urlencoded
CONTENT_LENGTH = 22

--
----
Daniel A. Shockley
email@hidden
email@hidden
http://www.danshockley.com


  • Prev by Date: Re: Source Text of Script Objects
  • Next by Date: Airport & Internet Connect under OS X
  • Previous by thread: Re: calling one procedure from with in another
  • Next by thread: Airport & Internet Connect under OS X
  • Index(es):
    • Date
    • Thread