Difference between revisions of "NetworkRequest"

From Lianjapedia
Jump to: navigation, search
(Methods)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
The NetworkRequest class allows the application to send network requests and receive replies. You can use it to upload and download files, web content, and perform HTTP GET, DELETE, and POST operations.
 
The NetworkRequest class allows the application to send network requests and receive replies. You can use it to upload and download files, web content, and perform HTTP GET, DELETE, and POST operations.
[[Category:Data Integration]]
+
 
 
Note: property, method and event names should be referred to in lowercase in case-sensitive scripting languages.
 
Note: property, method and event names should be referred to in lowercase in case-sensitive scripting languages.
  
Line 48: Line 48:
 
!Args
 
!Args
 
!width="50%"|Description
 
!width="50%"|Description
 +
|-
 +
|valign="top"|Delete
 +
|valign="top"|url as Character [, data as Character]
 +
|valign="top"|Sends a HTTP DELETE request to the specified url.  Optionally specify the data to delete (from v9.4.9).
 
|-
 
|-
 
|valign="top"|Getdata
 
|valign="top"|Getdata
Line 54: Line 58:
 
|-
 
|-
 
|valign="top"|Getfile
 
|valign="top"|Getfile
|valign="top"|url as Character, filename as Character
+
|valign="top"|url as Character, filename as Character<br>[, user as Character, password as Character<br>[, binary as Boolean]]
|valign="top"|Fetches the data from the specified url into the local file filename using an HTTP GET
+
|valign="top"|Fetches the data from the specified url into the local file filename using an HTTP/HTTPS GET.<br>For binary files, specify the binary arg as true (From v9.4).
 
|-
 
|-
 
|valign="top"|Isfinished
 
|valign="top"|Isfinished
Line 64: Line 68:
 
|valign="top"|None
 
|valign="top"|None
 
|valign="top"|Returns true if valid network connection
 
|valign="top"|Returns true if valid network connection
 +
|-
 +
|valign="top"|Patch
 +
|valign="top"|url as Character [, data as Character]
 +
|valign="top"|Sends a HTTP PATCH request to the specified url.  Optionally specify the data to modify (from v9.4.9).
 
|-
 
|-
 
|valign="top"|Postdata
 
|valign="top"|Postdata
|valign="top"|url as Character, data as Character [, filename as Character]
+
|valign="top"|url as Character, data as Character [, outfilename as Character]
|valign="top"|Sends the specified data to the url using an HTTP POST request.  If the optional filename is specified, the response is written to the file.
+
|valign="top"|Sends the specified data to the url using an HTTP POST request.  If the optional outfilename is specified, the response is written to the file.
 
|-
 
|-
 
|valign="top"|Postfile
 
|valign="top"|Postfile
|valign="top"|url as Character, filename as Character [,outfilename as Character]
+
|valign="top"|url as Character, filename as Character [, outfilename as Character]
 
|valign="top"|Sends the contents of the file filename to the specified url using an HTTP POST request. If the optional outfilename is specified, the response is written to the file.
 
|valign="top"|Sends the contents of the file filename to the specified url using an HTTP POST request. If the optional outfilename is specified, the response is written to the file.
 
|-
 
|-
Line 78: Line 86:
 
|-
 
|-
 
|valign="top"|Putfile
 
|valign="top"|Putfile
|valign="top"|url as Character, filename as Character [,outfilename as Character]
+
|valign="top"|url as Character, filename as Character [, outfilename as Character]
 
|valign="top"|Sends the contents of the file filename to the specified url using an HTTP PUT request. If the optional outfilename is specified, the response is written to the file.
 
|valign="top"|Sends the contents of the file filename to the specified url using an HTTP PUT request. If the optional outfilename is specified, the response is written to the file.
|-
 
|valign="top"|Delete
 
|valign="top"|url as Character
 
|valign="top"|Sends a HTTP DELETE request to the specified url
 
|-
 
 
|-
 
|-
 
|valign="top"|Reset
 
|valign="top"|Reset
Line 100: Line 103:
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Framework Classes]]
 
[[Category:Framework Classes]]
 +
[[Category:Data Integration]]
 +
[[Category:Lianja v9.4]]

Latest revision as of 06:17, 23 November 2023

The NetworkRequest class allows the application to send network requests and receive replies. You can use it to upload and download files, web content, and perform HTTP GET, DELETE, and POST operations.

Note: property, method and event names should be referred to in lowercase in case-sensitive scripting languages.

Properties

This class supports the following properties:

Property Access (R/RW) Value Description
Async W Boolean Whether operation is performed asynchronously (default false)
ErrorNumber R Numeric Number of last error
ErrorString R Character Message for last error
Password W Character Password for remote server
Username W Character User name for remote server

Methods

This class supports the following methods:

Method Args Description
Delete url as Character [, data as Character] Sends a HTTP DELETE request to the specified url. Optionally specify the data to delete (from v9.4.9).
Getdata url as Character Returns the requested data as a Character string
Getfile url as Character, filename as Character
[, user as Character, password as Character
[, binary as Boolean]]
Fetches the data from the specified url into the local file filename using an HTTP/HTTPS GET.
For binary files, specify the binary arg as true (From v9.4).
Isfinished None Returns true if asynchronous operation has finished, otherwise false
Networkaccessible None Returns true if valid network connection
Patch url as Character [, data as Character] Sends a HTTP PATCH request to the specified url. Optionally specify the data to modify (from v9.4.9).
Postdata url as Character, data as Character [, outfilename as Character] Sends the specified data to the url using an HTTP POST request. If the optional outfilename is specified, the response is written to the file.
Postfile url as Character, filename as Character [, outfilename as Character] Sends the contents of the file filename to the specified url using an HTTP POST request. If the optional outfilename is specified, the response is written to the file.
Putdata url as Character, data as Character Sends the specified data to the url using an HTTP PUT request
Putfile url as Character, filename as Character [, outfilename as Character] Sends the contents of the file filename to the specified url using an HTTP PUT request. If the optional outfilename is specified, the response is written to the file.
Reset None Resets the NetworkRequest object
Setheader name as Character, value as Character Adds a header name/value pair to the HTTP headers that will be sent with the request