Difference between revisions of "ISKernel:webrequest (Object Type)"

From Lavish Software Wiki
Jump to navigation Jump to search
(Created page with "== Description == {{ObjectType-Vitals|webrequest|Inner Space|none|webrequest|none|no|}} Manages a web request, e.g. to GET or POST with a http or https URL == Members ==...")
 
 
(3 intermediate revisions by the same user not shown)
Line 7: Line 7:
 
*[[ISKernel:ewebrequeststate (Object Type)|ewebrequeststate]] '''State''': State of the webrequest, e.g. Idle, Queued, Working, Completed, Aborted
 
*[[ISKernel:ewebrequeststate (Object Type)|ewebrequeststate]] '''State''': State of the webrequest, e.g. Idle, Queued, Working, Completed, Aborted
 
*[[ISKernel:ewebrequestas (Object Type)|ewebrequestas]] '''InterpretAs''': How to interpret the server's response content, such as file, string, json or binary
 
*[[ISKernel:ewebrequestas (Object Type)|ewebrequestas]] '''InterpretAs''': How to interpret the server's response content, such as file, string, json or binary
*[[ObjectType:string|string]] URL: The URL to request
+
*[[ObjectType:string|string]] '''URL''': The URL to request
 
*[[ObjectType:jsonarray|jsonarray]] '''POST''': A JSON array containing a list of objects that describe each POST parameter
 
*[[ObjectType:jsonarray|jsonarray]] '''POST''': A JSON array containing a list of objects that describe each POST parameter
*[[ObjectType:string|string]] Filename: The output filename
+
*[[ObjectType:string|string]] '''Filename''': The output filename, when interpreting as file
 
*[[ObjectType:jsonobject|jsonobject]] '''Result''': A JSON object containing response codes and data received as a result of the request
 
*[[ObjectType:jsonobject|jsonobject]] '''Result''': A JSON object containing response codes and data received as a result of the request
*[[ObjectType:binary|binary]] Binary: A binary object containing the server's response content
+
*[[ObjectType:binary|binary]] '''Binary''': A binary object containing the server's response content
  
  
Line 20: Line 20:
 
* '''Abort''': Aborts the webrequest. The webrequest must be in Queued state; an aborted webrequest will change to Aborted state when it otherwise would have changed to Working state.
 
* '''Abort''': Aborts the webrequest. The webrequest must be in Queued state; an aborted webrequest will change to Aborted state when it otherwise would have changed to Working state.
 
* '''SetURL['''url''']''': Sets the URL to use. The webrequest must be in Idle or Queued state to change the URL.
 
* '''SetURL['''url''']''': Sets the URL to use. The webrequest must be in Idle or Queued state to change the URL.
* '''InterpretAs['''as''']''': Tells the webrequest to provide the result as one of <tt>string>, <tt>json<tt>, <tt>binary</tt>
+
* '''InterpretAs['''as''']''': Tells the webrequest to provide the result as one of <tt>string</tt>, <tt>json</tt>, <tt>binary</tt>
 
* '''InterpretAs[file,'''absolute filename''']''': Tells the webrequest to provide the result as a file, to the specified '''absolute filename''' (it is recommended to include the full path)
 
* '''InterpretAs[file,'''absolute filename''']''': Tells the webrequest to provide the result as a file, to the specified '''absolute filename''' (it is recommended to include the full path)
  

Latest revision as of 11:01, 14 November 2019

Description

Object Type Vitals
webrequest
Defined By Inner Space
Inherits none
Reduces To webrequest
Variable Object Type none
Uses Sub-Types no
C/C++ Type

Manages a web request, e.g. to GET or POST with a http or https URL


Members

  • ewebrequeststate State: State of the webrequest, e.g. Idle, Queued, Working, Completed, Aborted
  • ewebrequestas InterpretAs: How to interpret the server's response content, such as file, string, json or binary
  • string URL: The URL to request
  • jsonarray POST: A JSON array containing a list of objects that describe each POST parameter
  • string Filename: The output filename, when interpreting as file
  • jsonobject Result: A JSON object containing response codes and data received as a result of the request
  • binary Binary: A binary object containing the server's response content


Methods

  • FromJSON[json]: Initializes the webrequest via a JSON object. The webrequest must be in its Idle (Reset) state
  • Reset: Resets the webrequest to its original Idle state, clearing any settings. The webrequest must not be in Working state. If in Queued state, this will act as :Abort instead
  • Begin: Begins the webrequest. The webrequest must be in Idle state, and a URL must be set
  • Abort: Aborts the webrequest. The webrequest must be in Queued state; an aborted webrequest will change to Aborted state when it otherwise would have changed to Working state.
  • SetURL[url]: Sets the URL to use. The webrequest must be in Idle or Queued state to change the URL.
  • InterpretAs[as]: Tells the webrequest to provide the result as one of string, json, binary
  • InterpretAs[file,absolute filename]: Tells the webrequest to provide the result as a file, to the specified absolute filename (it is recommended to include the full path)

See Also