Difference between revisions of "Experimental:Web Client DAT"

From TouchDesigner Documentation
Jump to: navigation, search
(Created page with "{{Summary |opFamily=DAT |opType=webclientDAT |opLabel=Web Client |opClass=webclientDAT_Class |opFilter=False |opLicense=Non-Commercial |short= |long=}} {{ParameterPage...")
(Tag: 2019.30350)
 
 
Line 7: Line 7:
 
|opLicense=Non-Commercial
 
|opLicense=Non-Commercial
 
|short=
 
|short=
|long=}}
+
|long=The Web Client DAT is the successor to the [[Web DAT]]. The Web Client DAT sends HTTP requests to web servers and then outputs the response in the DAT. With streaming enabled it can stream data from a web server.
 +
   
 +
When streaming is enabled, Clamp Output as Rows should be enabled. This turns the output of the DAT into a FIFO table instead of raw text. Only the last N lines will be displayed, where N is the value of the Maximum Lines parameter. This will prevent the text in the DAT from getting too larger and will keep cook-times down as a result.
 +
   
 +
The Web Client DAT supports sending of GET, POST, PUT, DELETE, HEAD, OPTIONS, and PATCH request methods. The Web Client DAT also supports 4 authentication methods: Basic, Digest, OAuth1, and OAuth2.
 +
 
 +
The first input is the extra headers to send in the request. It should be a table with 2 columns, structured as name/value pairs. For example:
 +
 
 +
{{{!}} border="1"
 +
{{!}}Content-Type
 +
{{!}}application/json
 +
{{!}}-
 +
{{!}}Connection
 +
{{!}}Close
 +
{{!}}}
 +
 
 +
The second input is the additional options to send in the request. These are query parameters which will be appended to the URL. This can be a table with two columns, structured as name/value pairs. It can also just be text, in which case it will append as-is. Example input:
 +
 
 +
{{{!}} border="1"
 +
{{!}}name
 +
{{!}}joe
 +
{{!}}-
 +
{{!}}month
 +
{{!}}May
 +
{{!}}}
 +
 
 +
See also: [[Web Server DAT]], [[SocketIO DAT]], [[XML DAT]], [[TCP/IP DAT]], [[WebSocket DAT]], [[Web DAT]].
 +
    }}
 
{{ParameterPage
 
{{ParameterPage
 
|opFamily=DAT
 
|opFamily=DAT
Line 20: Line 47:
 
|parReadOnly=
 
|parReadOnly=
 
|parOrder=0
 
|parOrder=0
|parSummary=
+
|parSummary=Toggles the operator on/off.
 
|parItems=}}
 
|parItems=}}
 
{{Parameter
 
{{Parameter
Line 30: Line 57:
 
|parReadOnly=
 
|parReadOnly=
 
|parOrder=1
 
|parOrder=1
|parSummary=
+
|parSummary=Selects the [https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods HTTP request method].
 
|parItems={{ParameterItem
 
|parItems={{ParameterItem
 
|opFamily=DAT
 
|opFamily=DAT
Line 36: Line 63:
 
|itemLabel=GET
 
|itemLabel=GET
 
|itemName=get
 
|itemName=get
|itemSummary=}}<!--
+
|itemSummary=The GET method requests a representation of the specified resource. Requests using GET should only retrieve data.}}{{ParameterItem
-->{{ParameterItem
 
 
|opFamily=DAT
 
|opFamily=DAT
 
|parName=reqmethod
 
|parName=reqmethod
 
|itemLabel=POST
 
|itemLabel=POST
 
|itemName=post
 
|itemName=post
|itemSummary=}}<!--
+
|itemSummary=The POST method is used to submit an entity to the specified resource, often causing a change in state or side effects on the server.}}<!--
 
-->{{ParameterItem
 
-->{{ParameterItem
 
|opFamily=DAT
 
|opFamily=DAT
Line 48: Line 74:
 
|itemLabel=PUT
 
|itemLabel=PUT
 
|itemName=put
 
|itemName=put
|itemSummary=}}<!--
+
|itemSummary=The PUT method replaces all current representations of the target resource with the request payload.}}<!--
 
-->{{ParameterItem
 
-->{{ParameterItem
 
|opFamily=DAT
 
|opFamily=DAT
Line 54: Line 80:
 
|itemLabel=DELETE
 
|itemLabel=DELETE
 
|itemName=delete
 
|itemName=delete
|itemSummary=}}<!--
+
|itemSummary=The DELETE method deletes the specified resource.}}<!--
 
-->{{ParameterItem
 
-->{{ParameterItem
 
|opFamily=DAT
 
|opFamily=DAT
Line 60: Line 86:
 
|itemLabel=HEAD
 
|itemLabel=HEAD
 
|itemName=head
 
|itemName=head
|itemSummary=}}<!--
+
|itemSummary=The HEAD method asks for a response identical to that of a GET request, but without the response body.}}<!--
 
-->{{ParameterItem
 
-->{{ParameterItem
 
|opFamily=DAT
 
|opFamily=DAT
Line 66: Line 92:
 
|itemLabel=OPTIONS
 
|itemLabel=OPTIONS
 
|itemName=options
 
|itemName=options
|itemSummary=}}<!--
+
|itemSummary=The OPTIONS method is used to describe the communication options for the target resource.}}<!--
 
-->{{ParameterItem
 
-->{{ParameterItem
 
|opFamily=DAT
 
|opFamily=DAT
Line 72: Line 98:
 
|itemLabel=PATCH
 
|itemLabel=PATCH
 
|itemName=patch
 
|itemName=patch
|itemSummary=}}}}
+
|itemSummary=The PATCH method is used to apply partial modifications to a resource.}}}}
 
{{Parameter
 
{{Parameter
 
|opFamily=DAT
 
|opFamily=DAT
Line 81: Line 107:
 
|parReadOnly=
 
|parReadOnly=
 
|parOrder=2
 
|parOrder=2
|parSummary=
+
|parSummary=The URL of the server to send the HTTP request
 
|parItems=}}
 
|parItems=}}
 
{{Parameter
 
{{Parameter
Line 91: Line 117:
 
|parReadOnly=
 
|parReadOnly=
 
|parOrder=3
 
|parOrder=3
|parSummary=
+
|parSummary=Sends the request
 
|parItems=}}
 
|parItems=}}
 
{{Parameter
 
{{Parameter
Line 101: Line 127:
 
|parReadOnly=
 
|parReadOnly=
 
|parOrder=4
 
|parOrder=4
|parSummary=
+
|parSummary=Stops the stream of data from the server.
 
|parItems=}}
 
|parItems=}}
 
{{Parameter
 
{{Parameter
Line 111: Line 137:
 
|parReadOnly=
 
|parReadOnly=
 
|parOrder=5
 
|parOrder=5
|parSummary=
+
|parSummary=Enables streaming. This is only necessary to enable if the server support streaming.
 
|parItems=}}
 
|parItems=}}
 
{{Parameter
 
{{Parameter
Line 121: Line 147:
 
|parReadOnly=
 
|parReadOnly=
 
|parOrder=6
 
|parOrder=6
|parSummary=
+
|parSummary=Enables TLS (transport layer security) certificate verification.
 
|parItems=}}
 
|parItems=}}
 
{{Parameter
 
{{Parameter
Line 131: Line 157:
 
|parReadOnly=
 
|parReadOnly=
 
|parOrder=7
 
|parOrder=7
|parSummary=
+
|parSummary=Timeout of the request if no response is received from the web server.
 
|parItems=}}
 
|parItems=}}
 
{{Parameter
 
{{Parameter
Line 141: Line 167:
 
|parReadOnly=
 
|parReadOnly=
 
|parOrder=8
 
|parOrder=8
|parSummary=
+
|parSummary=Includes the header in the output of the response.
 
|parItems=}}
 
|parItems=}}
 
{{Parameter
 
{{Parameter
Line 151: Line 177:
 
|parReadOnly=
 
|parReadOnly=
 
|parOrder=9
 
|parOrder=9
|parSummary=
+
|parSummary=Enables asynchronous sending/receiving (ie. TouchDesigner doesn't hang while waiting for a response from the web server).
 
|parItems=}}}}
 
|parItems=}}}}
 
{{ParameterPage
 
{{ParameterPage
Line 165: Line 191:
 
|parReadOnly=
 
|parReadOnly=
 
|parOrder=0
 
|parOrder=0
|parSummary=
+
|parSummary=The type of authentication.
 
|parItems={{ParameterItem
 
|parItems={{ParameterItem
 
|opFamily=DAT
 
|opFamily=DAT
Line 171: Line 197:
 
|itemLabel=None
 
|itemLabel=None
 
|itemName=none
 
|itemName=none
|itemSummary=}}<!--
+
|itemSummary=No authentication}}<!--
 
-->{{ParameterItem
 
-->{{ParameterItem
 
|opFamily=DAT
 
|opFamily=DAT
Line 177: Line 203:
 
|itemLabel=Basic
 
|itemLabel=Basic
 
|itemName=basic
 
|itemName=basic
|itemSummary=}}<!--
+
|itemSummary=Basic authentication is base-64 encoded username and password.}}<!--
 
-->{{ParameterItem
 
-->{{ParameterItem
 
|opFamily=DAT
 
|opFamily=DAT
Line 183: Line 209:
 
|itemLabel=Digest
 
|itemLabel=Digest
 
|itemName=digest
 
|itemName=digest
|itemSummary=}}<!--
+
|itemSummary=Digest authentication is base-64 encoded username and password that's encrypted with a hashing function. Digest is a more secure version of Basic authentication.}}<!--
 
-->{{ParameterItem
 
-->{{ParameterItem
 
|opFamily=DAT
 
|opFamily=DAT
Line 189: Line 215:
 
|itemLabel=OAuth1
 
|itemLabel=OAuth1
 
|itemName=ouath1
 
|itemName=ouath1
|itemSummary=}}<!--
+
|itemSummary=Version 1 of OAuth. OAuth1 requires App Key, App Secret, User OAuth Token, and User OAuth Secret. These can be found via the account on the web server that request is being sent to. For example, in the case of the Twitter API the values of these 4 parameters can be found under the account profile.}}<!--
 
-->{{ParameterItem
 
-->{{ParameterItem
 
|opFamily=DAT
 
|opFamily=DAT
Line 195: Line 221:
 
|itemLabel=OAuth2
 
|itemLabel=OAuth2
 
|itemName=ouath2
 
|itemName=ouath2
|itemSummary=}}}}
+
|itemSummary=Version 2 of OAuth. OAuth2 first requires an HTTP request be sent to the web server to acquire the Client ID and token. It can be acquired using a browser.}}}}
 
{{Parameter
 
{{Parameter
 
|opFamily=DAT
 
|opFamily=DAT
Line 204: Line 230:
 
|parReadOnly=
 
|parReadOnly=
 
|parOrder=1
 
|parOrder=1
|parSummary=
+
|parSummary=Username used in Basic/Digest authentication.
 
|parItems=}}
 
|parItems=}}
 
{{Parameter
 
{{Parameter
Line 214: Line 240:
 
|parReadOnly=
 
|parReadOnly=
 
|parOrder=2
 
|parOrder=2
|parSummary=
+
|parSummary=Password used in Basic/Digest authentication.
 
|parItems=}}
 
|parItems=}}
 
{{Parameter
 
{{Parameter
Line 224: Line 250:
 
|parReadOnly=
 
|parReadOnly=
 
|parOrder=3
 
|parOrder=3
|parSummary=
+
|parSummary=OAuth1 App Key retrieved from web server.
 
|parItems=}}
 
|parItems=}}
 
{{Parameter
 
{{Parameter
Line 234: Line 260:
 
|parReadOnly=
 
|parReadOnly=
 
|parOrder=4
 
|parOrder=4
|parSummary=
+
|parSummary=OAuth1 App Secret retrieved from web server.
 
|parItems=}}
 
|parItems=}}
 
{{Parameter
 
{{Parameter
Line 244: Line 270:
 
|parReadOnly=
 
|parReadOnly=
 
|parOrder=5
 
|parOrder=5
|parSummary=
+
|parSummary=OAuth1 user token retrieved from web server.
 
|parItems=}}
 
|parItems=}}
 
{{Parameter
 
{{Parameter
Line 254: Line 280:
 
|parReadOnly=
 
|parReadOnly=
 
|parOrder=6
 
|parOrder=6
|parSummary=
+
|parSummary=OAuth1 user secret retrieved from web server.
 
|parItems=}}
 
|parItems=}}
 
{{Parameter
 
{{Parameter
Line 264: Line 290:
 
|parReadOnly=
 
|parReadOnly=
 
|parOrder=7
 
|parOrder=7
|parSummary=
+
|parSummary=OAuth2 Client ID retrieved from web server.
 
|parItems=}}
 
|parItems=}}
 
{{Parameter
 
{{Parameter
Line 274: Line 300:
 
|parReadOnly=
 
|parReadOnly=
 
|parOrder=8
 
|parOrder=8
|parSummary=
+
|parSummary=OAuth2 token retrieved from web server.
 
|parItems=}}}}
 
|parItems=}}}}
 
{{ParameterPage
 
{{ParameterPage
Line 288: Line 314:
 
|parReadOnly=
 
|parReadOnly=
 
|parOrder=0
 
|parOrder=0
|parSummary=
+
|parSummary=Clears the output of the DAT.
 
|parItems=}}
 
|parItems=}}
 
{{Parameter
 
{{Parameter
Line 298: Line 324:
 
|parReadOnly=
 
|parReadOnly=
 
|parOrder=1
 
|parOrder=1
|parSummary=
+
|parSummary=When enabled, the output of the DAT is table instead of text. The rows will also be clamped to Maximum lines parameter value. This should be enabled when streaming is enabled too ensure that the output does not get too large.
 
|parItems=}}
 
|parItems=}}
 
{{Parameter
 
{{Parameter
Line 308: Line 334:
 
|parReadOnly=
 
|parReadOnly=
 
|parOrder=2
 
|parOrder=2
|parSummary=
+
|parSummary=The maximum number of rows when clamping is enabled.
 
|parItems=}}
 
|parItems=}}
 
{{Parameter
 
{{Parameter
Line 318: Line 344:
 
|parReadOnly=
 
|parReadOnly=
 
|parOrder=3
 
|parOrder=3
|parSummary=
+
|parSummary=The Callbacks DAT.
 
|parItems=}}}}
 
|parItems=}}}}
 
{{:DAT Generator Common Page}}
 
{{:DAT Generator Common Page}}

Latest revision as of 17:20, 12 August 2019

Summary
[edit]

The Web Client DAT is the successor to the Web DAT. The Web Client DAT sends HTTP requests to web servers and then outputs the response in the DAT. With streaming enabled it can stream data from a web server.

When streaming is enabled, Clamp Output as Rows should be enabled. This turns the output of the DAT into a FIFO table instead of raw text. Only the last N lines will be displayed, where N is the value of the Maximum Lines parameter. This will prevent the text in the DAT from getting too larger and will keep cook-times down as a result.

The Web Client DAT supports sending of GET, POST, PUT, DELETE, HEAD, OPTIONS, and PATCH request methods. The Web Client DAT also supports 4 authentication methods: Basic, Digest, OAuth1, and OAuth2.

The first input is the extra headers to send in the request. It should be a table with 2 columns, structured as name/value pairs. For example:

Content-Type application/json
Connection Close

The second input is the additional options to send in the request. These are query parameters which will be appended to the URL. This can be a table with two columns, structured as name/value pairs. It can also just be text, in which case it will append as-is. Example input:

name joe
month May

See also: Web Server DAT, SocketIO DAT, XML DAT, TCP/IP DAT, WebSocket DAT, Web DAT.

PythonIcon.pngwebclientDAT_Class


Parameters - Web Client Page

Active active - Toggles the operator on/off.  

Request Method reqmethod - - Selects the HTTP request method.

  • GET get - The GET method requests a representation of the specified resource. Requests using GET should only retrieve data.
  • POST post - The POST method is used to submit an entity to the specified resource, often causing a change in state or side effects on the server.
  • PUT put - The PUT method replaces all current representations of the target resource with the request payload.
  • DELETE delete - The DELETE method deletes the specified resource.
  • HEAD head - The HEAD method asks for a response identical to that of a GET request, but without the response body.
  • OPTIONS options - The OPTIONS method is used to describe the communication options for the target resource.
  • PATCH patch - The PATCH method is used to apply partial modifications to a resource.

URL url - The URL of the server to send the HTTP request  

Request request - Sends the request  

Stop stop - Stops the stream of data from the server.  

Stream stream - Enables streaming. This is only necessary to enable if the server support streaming.  

Verify Certificate (SSL) verifycert - Enables TLS (transport layer security) certificate verification.  

Timeout timeout - Timeout of the request if no response is received from the web server.  

Include Header in Output includeheader - Includes the header in the output of the response.  

Asynchronous async - Enables asynchronous sending/receiving (ie. TouchDesigner doesn't hang while waiting for a response from the web server).  


Parameters - Authentication Page

Authentication Type authtype - - The type of authentication.

  • None none - No authentication
  • Basic basic - Basic authentication is base-64 encoded username and password.
  • Digest digest - Digest authentication is base-64 encoded username and password that's encrypted with a hashing function. Digest is a more secure version of Basic authentication.
  • OAuth1 ouath1 - Version 1 of OAuth. OAuth1 requires App Key, App Secret, User OAuth Token, and User OAuth Secret. These can be found via the account on the web server that request is being sent to. For example, in the case of the Twitter API the values of these 4 parameters can be found under the account profile.
  • OAuth2 ouath2 - Version 2 of OAuth. OAuth2 first requires an HTTP request be sent to the web server to acquire the Client ID and token. It can be acquired using a browser.

Username username - Username used in Basic/Digest authentication.  

Password pw - Password used in Basic/Digest authentication.  

App Key appkey - OAuth1 App Key retrieved from web server.  

App Secret appsecret - OAuth1 App Secret retrieved from web server.  

User OAuth Token oauthtoken - OAuth1 user token retrieved from web server.  

User OAuth Secret oauthsecret - OAuth1 user secret retrieved from web server.  

Client ID clientid - OAuth2 Client ID retrieved from web server.  

Token token - OAuth2 token retrieved from web server.  


Parameters - Output Page

Clear Output clear - Clears the output of the DAT.  

Clamp Output as Rows clamp - When enabled, the output of the DAT is table instead of text. The rows will also be clamped to Maximum lines parameter value. This should be enabled when streaming is enabled too ensure that the output does not get too large.  

Maximum Lines maxlines - The maximum number of rows when clamping is enabled.  

Callbacks DAT callbacks - The Callbacks DAT.  


Parameters - Common Page

Language language - - Select how the DAT decides which script language to operate on.

  • Input input - The DAT uses the inputs script language.
  • Node node - The DAT uses it's own script language.

Edit/View Extension extension - - Select the file extension this DAT should expose to external editors.

  • dat dat - various common file extensions.
  • From Language language - pick extension from DATs script language.
  • Custom Extension custom - Specify a custom extension.

Custom Extension customext - Specifiy the custom extension.  

Word Wrap wordwrap - - Enable Word Wrap for Node Display.

  • Input input - The DAT uses the inputs setting.
  • On on - Turn on Word Wrap.
  • Off off - Turn off Word Wrap.


Operator Inputs

  • Input 0 -
  • Input 1 -


DATs
Art-Net • CHOP Execute • CHOP to • Clip • Convert • CPlusPlus • DAT •  Execute • DAT xport • Error • EtherDream • Evaluate • Examine • Execute • FIFO • File In • File Out • Folder • In • Indices • Info • Insert • Introduction To DATs id • Keyboard In • Lookup • Merge • MIDI Event • MIDI In • Monitors • MQTT Client • Multi Touch In • NDI • Null • OP Execute • OP Find • OSC In • OSC Out • Out • Panel Execute • Parameter • Parameter Execute • Perform • Render Pick • Reorder • Script • Select • Serial • Experimental:SocketIO • SOP to • Sort • Substitute • Switch • Table • TCP/IP • Text • Touch In • Touch Out • Transpose • TUIO In • UDP In • UDP Out • UDT In • UDT Out • Experimental:Web Client • Web • Experimental:Web Server • WebSocket • XML

An Operator Family that manipulates text strings: multi-line text or tables. Multi-line text is often a command Script, but can be any multi-line text. Tables are rows and columns of cells, each containing a text string.

The generic thing that holds an Operator, and includes Flags (display, bypass, lock, render, immune) and its position/size in the network. Whether you "lay down an Operator" or "lay down an Node", you're doing the same thing.