ServiceRequest[service,"req"]

represents a service request built from service, which might be a connected ServiceObject or a valid service name, and request "req".

ServiceRequest[service,"req",param]

represents a service request, built from the service service, request "req" and parameters param.

ServiceRequest[assoc]

represents a service request, built from association assoc.

Details

  • ServiceRequest gives a symbolic representation of a service request; it does not execute the request.
  • The following entries must be given in the association:
  • "Request"request to be made
    "Parameters"parameters for the request
    "Service"name of the service or service object
  • ServiceRequest[]["prop"] extracts the value for the property prop of the service request.
  • Possible properties include all components and additional elements, as well as:
  • "Service"external service
    "Request"request name
    "Parameters"request parameters
    "Properties"list of all possible properties
    "PropertyAssociation"association giving values of all properties

Examples

Basic Examples  (3)

Create a request for "PubChem" service:

In[1]:=
Click for copyable input
Out[1]=

List requests supported by the "PubChem" service:

In[2]:=
Click for copyable input
Out[2]=

Open a connection to an external service:

In[1]:=
Click for copyable input
Out[1]=

Create a request:

In[2]:=
Click for copyable input
Out[2]=

Get properties:

In[3]:=
Click for copyable input
Out[3]=

Extract properties from the request:

In[4]:=
Click for copyable input
Out[4]=

Get request data as "PropertyAssociation":

In[5]:=
Click for copyable input
Out[5]=

Execute the request:

In[6]:=
Click for copyable input
Out[6]=

Submit the request and set result:

In[7]:=
Click for copyable input
Out[7]=
In[8]:=
Click for copyable input
Out[8]=

Build a request with an association:

In[1]:=
Click for copyable input
Out[1]=

Execute the request:

In[2]:=
Click for copyable input
Out[2]=
Introduced in 2019
(12.0)