Difference between revisions of "GETURL()"
From Lianjapedia
Yvonne.milne (Talk | contribs) (→Description) |
|||
(13 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
==Purpose== | ==Purpose== | ||
− | Function to | + | Function to talk with HTTP web servers and consume data provided by web services |
− | + | ||
==Syntax== | ==Syntax== | ||
− | GETURL(< | + | GETURL(<expC1> [, <expN> [, <expO> | <array> [, expC2>]]]) |
− | + | ||
==See Also== | ==See Also== | ||
− | [[AT()]], [[ATNEXT()]], [[FCLOSE()]], [[FCREATE()]], [[FERROR()]], [[FGETS()]], [[FILETOSTR()]], [[FOPEN()]], [[FPUTS()]], [[FREAD()]], [[FREADSTR()]], [[FWRITE()]], [[ISSERVER()]], [[SUBSTR()]], [[STUFF()]], [[STR()]], [[STREXTRACT()]], [[STRTOFILE()]], [[STRTRAN()]], [[STRZERO()]], [[TRIM()]] | + | [[AT()]], [[ATNEXT()]], [[FCLOSE()]], [[FCREATE()]], [[FERROR()]], [[FGETS()]], [[FILETOSTR()]], [[FOPEN()]], [[FPUTS()]], [[FREAD()]], [[FREADSTR()]], [[FWRITE()]], [[ISSERVER()]], [[JSON_DECODE_FILE()]], [[POSTURL()]], [[SUBSTR()]], [[STUFF()]], [[STR()]], [[STREXTRACT()]], [[STRTOFILE()]], [[STRTRAN()]], [[STRZERO()]], [[TRIM()]], [[XML_DECODE_FILE()]] |
− | + | ||
==Description== | ==Description== | ||
− | The GETURL() function | + | The GETURL() function is used to talk with HTTP web servers and consume data provided by web services. |
+ | For HTTPS and FTP operations, see [[Web Integration]] and the [[NetworkRequest]] class. | ||
+ | {| class="wikitable" width="100%" | ||
+ | !width="20%"|Parameter||Description||Example | ||
+ | |- | ||
+ | |<expC1>||Fully qualified URI||"http://search.twitter.com/search.json?q=twitterapi&rpp=1" | ||
+ | |- | ||
+ | |valign="top"|<expN>||The timeout in seconds for the request (default 30). Set this to 0 for no timeout.||valign=top|30 | ||
+ | |- | ||
+ | |valign="top"|<expO> |<br/><array>||valign=top|An object or dynamic array containing the HTTP header elements | ||
+ | |headers = array()<br/>headers[] = "Host: search.twitter.com"<br/>headers[] = "Authentication: Basic " + base64_encode("username:password") | ||
+ | |- | ||
+ | |<expC2>||Name of file in which to store data||"myfilename.json" | ||
+ | |- | ||
+ | |} | ||
==Example== | ==Example== | ||
<code lang="recital"> | <code lang="recital"> | ||
− | + | filename = geturl("http://www.myserver.com/getsomepage.rsp?name=smith&month=10", 30, array(), "myfilename.json") | |
− | + | if len(filename) = 0 | |
− | + | // no data was returned | |
− | + | endif | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
</code> | </code> | ||
− | |||
− | |||
− | |||
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:Functions]] | [[Category:Functions]] | ||
+ | [[Category:Data Integration]] |
Latest revision as of 07:55, 6 January 2020
Contents
Purpose
Function to talk with HTTP web servers and consume data provided by web services
Syntax
GETURL(<expC1> [, <expN> [, <expO> | <array> [, expC2>]]])
See Also
AT(), ATNEXT(), FCLOSE(), FCREATE(), FERROR(), FGETS(), FILETOSTR(), FOPEN(), FPUTS(), FREAD(), FREADSTR(), FWRITE(), ISSERVER(), JSON_DECODE_FILE(), POSTURL(), SUBSTR(), STUFF(), STR(), STREXTRACT(), STRTOFILE(), STRTRAN(), STRZERO(), TRIM(), XML_DECODE_FILE()
Description
The GETURL() function is used to talk with HTTP web servers and consume data provided by web services.
For HTTPS and FTP operations, see Web Integration and the NetworkRequest class.
Parameter | Description | Example |
---|---|---|
<expC1> | Fully qualified URI | "http://search.twitter.com/search.json?q=twitterapi&rpp=1" |
<expN> | The timeout in seconds for the request (default 30). Set this to 0 for no timeout. | 30 |
<expO> | <array> |
An object or dynamic array containing the HTTP header elements | headers = array() headers[] = "Host: search.twitter.com" headers[] = "Authentication: Basic " + base64_encode("username:password") |
<expC2> | Name of file in which to store data | "myfilename.json" |
Example
filename = geturl("http://www.myserver.com/getsomepage.rsp?name=smith&month=10", 30, array(), "myfilename.json") if len(filename) = 0 // no data was returned endif