User Tools

Site Tools


dictionary:more:loadurl

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Next revisionBoth sides next revision
dictionary:more:loadurl [2017/04/24 15:35] – external edit 127.0.0.1dictionary:more:loadurl [2018/09/01 16:42] – [Optional Parameters:] James Sentman
Line 3: Line 3:
  
 loadURL can connect to secure web sites over SSL by just making sure the URL parameter begins with "https://“ instead of just “http:// loadURL can connect to secure web sites over SSL by just making sure the URL parameter begins with "https://“ instead of just “http://
 +
 +As of XTension version 9.4 the loadURL command now supports the 1.3 version of TLS security required by some sites and also adds digest authentication as an automatic response to sites or devices that require that.
  
 ===Usage:=== ===Usage:===
Line 14: Line 16:
 **post data** (list: an applescript list of name=value pairs to be POSTED to the server. To send GET parameters include them in the url string as shown above. The list would look something like {“name=value”, “name2=value2”, “name2=value3”,...} )\\ **post data** (list: an applescript list of name=value pairs to be POSTED to the server. To send GET parameters include them in the url string as shown above. The list would look something like {“name=value”, “name2=value2”, “name2=value3”,...} )\\
 **callback script** (text: the name of the global script to send the results to) If you leave this option out but include the handler name then the (thisScript) property will be used to try to call back into the same script that ran the loadURL command.\\ **callback script** (text: the name of the global script to send the results to) If you leave this option out but include the handler name then the (thisScript) property will be used to try to call back into the same script that ran the loadURL command.\\
-**callback handler** (text: the name of the handler in the global script handler to send the response, or error, to.) +**callback handler** (text: the name of the handler in the global script handler to send the response, or error, to.)\\ 
 +**custom request** (text: a request type other than GET or POST) optional, if you need to send an HTTP request other than GET or PUT set the value here. If you need to send custom PUT or POST data that isn’t form encoded use the **put data** parameter below.\\ 
 +**follow redirects** (boolean: should the request be repeated if the server responds with a redirect) This defaults to true so by specifying “without follow redirects” you can stop it from trying to follow them.\\ 
 +**logging debug data** (boolean: logs all the communication and all the protocol negotiation data) Optional. Defaults to false, turn it on by adding “with logging debug data” to the command. Logs absolutely everything to the log. Good for debugging why something isn’t responding but not good to leave setup all the time.\\ 
 +**put data** (text: optional) if included the post type will default to PUT and the block of data that you specify in this string will be sent to the server. If you change the request type via the custom request handler above then you can use this to send non-form encoded blocks of any data to the server.\\ 
 +**extra headers** (list: optional) an applescript list of text items that will be added to the headers being sent.
 ===Callback Handler Info:=== ===Callback Handler Info:===
  
Line 23: Line 29:
  
 <code> <code>
-on myCallback( theResult, theData)+on myCallback( theResult, theData, theTime) 
 +  write log “the request took: “ & theTime & “ milliseconds to complete"
   if theResult is -1 then   if theResult is -1 then
     write log “there was a timeout trying to connect to my server” color red     write log “there was a timeout trying to connect to my server” color red
Line 33: Line 40:
 end myCallback end myCallback
 </code> </code>
- 
 ===Examples:=== ===Examples:===
 **LoadURL** “https://www.apple.com/?these=are&get=parameters” **timeout** 120 **post data** {“name=value”, “name=value”} **callback script** “my global handler” **callback handler** “myCallback”  **LoadURL** “https://www.apple.com/?these=are&get=parameters” **timeout** 120 **post data** {“name=value”, “name=value”} **callback script** “my global handler” **callback handler** “myCallback” 
 +
 +===History===
 +  * **put data** parameter was added in XTension 9.4.7
 +  * **custom request** parameter was added in XTension v9.4
 +  * **follow redirects** parameter was added in XTension v9.4
 +  * **logging debug data** parameter was added in XTension v9.4
 +
dictionary/more/loadurl.txt · Last modified: 2023/02/13 14:52 by 127.0.0.1