Register to post in forums, or Log in to your existing account
 

 Related 
Contents
Function Reference
  %abs
  %additem
  %addkey
  %alarm
  %alias
  %ansi
  %array
  %arrget
  %arrhigh
  %arrset
  %ascii
  %average
  %begins
  %bitand
  %bitnot
  %bitor
  %bitset
  %bitshift
  %bittest
  %bitxor
  %btncol
  %btnenable
  %btnimage
  %case
  %char
  %charcomment
  %charnotes
  %class
  %clip
  %color
  %colorname
  %colorsyntax
  %comactive
  %comcreate
  %comget
  %comset
  %concat
  %copy
  %count
  %countlist
  %crtonl
  %db
  %dbget
  %dbitems
  %dbkey
  %dbkeys
  %dblist
  %dbmax
  %dbmin
  %dbvalues
  %dde
  %ddeclose
  %ddemacro
  %ddeopen
  %ddepoke
  %defined
  %delete
  %delitem
  %delkey
  %delnitem
  %destroom
  %dice
  %diceavg
  %dicedev
  %dicemax
  %dicemin
  %doorname
  %dups
  %ends
  %eval
  %exec
  %exp
  %expand
  %expanddb
  %expandlist
  %filesize
  %find
  %float
  %format
  %getglobal
  %grep
  %gsl
  %handle
  %hexcolor
  %hexnum
  %hexstr
  %htmldecode
  %htmlencode
  %iconstate
  %if
  %insert
  %int
  %inwalk
  %isfloat
  %iskey
  %ismember
  %isnumber
  %isvalue
  %item
  %json
  %lastdir
  %left
  %leftback
  %len
  %line
  %list
  %literal
  %look
  %lower
  %mapfilter
  %maplocked
  %mapquery
  %mapvnum
  %match
  %max
  %mcp
  %min
  %mod
  %mss
  %nextdir
  %nltocr
  %norm
  %null
  %number
  %numbuttons
  %numitems
  %numkeys
  %numparam
  %numrec
  %numrooms
  %numwords
  %numzones
  %packages
  %param
  %params
  %parsemode
  %parsenumbers
  %pat
  %pathcompress
  %pathexpand
  %pathfrom
  %pathreverse
  %pick
  %pop
  %portal
  %portalenabled
  %pos
  %pref
  %priority
  %prompt
  %proper
  %push
  %query
  %quote
  %random
  %read
  %ref
  %regex
  %remove
  %repeat
  %replace
  %replaceitem
  %reversedir
  %rgb
  %right
  %rightback
  %roomcol
  %roomcom
  %roomcontents
  %roomcost
  %roomdesc
  %roomexit
  %roomflags
  %roomid
  %roomint
  %roomkey
  %roomkind
  %roomlink
  %roomload
  %roommode
  %roomname
  %roomnote
  %roomnum
  %roomportal
  %roomvnum
  %roomzone
  %round
  %section
  %setglobal
  %sort
  %sql
  %sqldb
  %sqrt
  %state
  %stdev
  %string
  %stripansi
  %stripq
  %subchar
  %subregex
  %sum
  %switch
  %threadid
  %threadname
  %time
  %trigger
  %trim
  %trimleft
  %trimright
  %upper
  %url
  %vartype
  %viewrec
  %walk
  %walkactive
  %walkconfirm
  %walkmode
  %walkroom
  %window
  %word
  %write
  %yesno
  %zonename
  %zonenum
  %zonevnum
Related Links:
  #YESNO
  Sounds and Externals
  MXP
%url [[cmud_%url]] 
Added in v3.23 (CMUDPro/TeSSH ONLY)
url

Syntax: %url(url)

Creates and returns a URL object that can be used to perform HTTP GET/POST operations. Allows you to retrieve data from remote web sources.

NOTE: This function is only available in CMUDPro (and TeSSH)

The following properties and methods are available on the object returned from the %url function:

Properties

  • Host : Sets or retrieves the Hostname field for the current URL.
  • Port : Sets or retrieves the Port field for the current URL
  • Protocol : Sets or retrieves the Protocol field for the current URL. Typically the Protocol field is "http".
  • Path : Sets or retrieves the Path field for the current URL.
  • Filename : Sets or retrieves the Filename field for the current URL.
  • Anchor : Sets or retrieves the Anchor field for the current URL.
  • Username : Sets or retrieves the Username field for the current URL, used for some web page authentication.
  • Password : Sets or retrieves the Password field for the current URL used for some web page authentication.
  • URL : Sets or retrieves the full URL (URI) string
  • ParamStr : Sets or retrieves the full query string of the current URL.
  • Params : A database variable that can be used to set or retrieve query string parameters by key or index value
  • PostParamStr : Sets the full POST parameters string value
  • PostParams : A database variable that can be used to set or retrieve POST parameters by key or index value
  • ContentType : Returns the type of result in MIME format, such as "text/html".
  • ContentLength : Returns the length of content from a Get or Header method.
  • ContentData : Returns the date of the content
  • ContentExpires : Returns the expiration date of the content
  • ContentModified : Returns the date the content was last modified
  • ContentLanguage : Returns the language of the content
  • Location : Returns the Location header of a HTTP redirection request.
  • ResponseCode : Returns the numeric HTTP Response code
  • ResponseText : Returns the full response status text
  • ProxyHost : the IP address or host name of a web proxy server.
  • ProxyPort : the port number of a web proxy server
  • ProxyUsername : when using a web proxy server that requires login, this is the login username.
  • ProxyPassword : when using a web proxy server that requires login, this is the login password.

Methods

  • Get : Performs an HTTP GET request on the URL and returns the full string result
  • Post : Performs an HTTP POST request, sending the PostParams and returns the full string result
  • Header : Performs an HTTP HEAD request and returns the full string result
  • Browse : Opens the URL in an external web browser
  • Download(Filename, method) : Downloads the URL to the specified local file. If "method" is present and true (1) then a POST is used instead of a GET to download the remote file.


Example

u = %url("www.google.com")
#SHOW @u.Get

Displays the HTML returned from the google.com home page.

u = %url("www.server.com")
u.PostParams("name") = zugg
u.PostParams("key") = value
s = @u.Post

Performs an HTTP POST with the PostParams string of "name=zugg&key=value" and stores the result in the @s variable.

u = %url("http://www.whatever.com/script.php?arg=value")
#SHOW @u.Params("arg")

displays "value"
Viewer Comments [0 - Post your comments]

Jump to:  

© 2009 Zugg Software. Hosted by Wolfpaw.net