ProtoFlux:GET String: Difference between revisions

From Resonite Wiki
try to add info, and fix visual
m fixed typos, improved grammar/style of a note
 
(4 intermediate revisions by 3 users not shown)
Line 18: Line 18:
|}}
|}}


GET String sends a HTTP request with GET method on call and decode its content as if the response has header of <code>Content-Type: plain/text; charset=utf-8</code>. So this is not suitable for binary-transmission.
GET String sends a HTTP request with GET method on call and decode its content with given charset in the <code>Content-Type</code> header (See [https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type MDN] to obtain more info about the header). Defaults to UTF-8 if charset is not present in the header, or the header itself does not exist.  


Authorization - i.e. via BasicAuth - is currently ''not'' supported.
{{Note|This is not suitable for binary-transmission, as this node decodes the whole response as a human-readable string. Consider using one of the [[:Category:Components:Assets|Asset Providers]] if your intention is fetching remote assets such as [[Component:StaticTexture2D|Texture2D]].|information}}
{{Note|This node is best used with an impulse from the client actually wanting to fulfill the data transfer task. See [[Connecting_Resonite_to_Other_Applications#Security / Consent|Security/Consent and surrounding info.]]|information}}
{{Note|This node is best used with an impulse from the client actually wanting to fulfill the data transfer task. See [[Connecting_Resonite_to_Other_Applications#Security / Consent|Security/Consent and surrounding info.]]|information}}


Line 26: Line 28:
=== * ([[Impulses|AsyncCall]]) ===
=== * ([[Impulses|AsyncCall]]) ===


Trigger to send a get request with a header of <code>Content-Type: plain/text; charset=utf-8</code> to the URL ([[Type:Uri|Uri]]) server location
Trigger to send a get request to the URL ([[Type:Uri|Uri]]) server location


=== URL ([[Type:Uri|Uri]]) ===
=== URL ([[Type:Uri|Uri]]) ===
Line 44: Line 46:
=== OnError ([[Impulses|Continuation]]) ===
=== OnError ([[Impulses|Continuation]]) ===


{{Stub}}
Fires after the HTTP client concludes that the request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout.


=== OnDenied ([[Impulses|Continuation]]) ===
=== OnDenied ([[Impulses|Continuation]]) ===


{{Stub}}
Fires after the user processing the request denied access request prompt to the Uri host, or denied by their setting. Please see [[Connecting_Resonite_to_Other_Applications#Security / Consent|external connection page]] for more information.


=== StatusCode ([[Type:HttpStatusCode|HTTP Status Code]]) ===  
=== StatusCode ([[Type:HttpStatusCode|HTTP Status Code]]) ===  


The code that the server responded with, no matter if it failed, was denied, succeeded at a response, or returned an error. This only exists during the OnResponse ([[Impulses|Continuation]]), OnError ([[Impulses|Continuation]]), and OnDenied ([[Impulses|Continuation]]) impulses.
The code that the server responded with, no matter if it failed, was denied, succeeded at a response, or returned an error. This only exists during the OnResponse ([[Impulses|Continuation]]), OnError ([[Impulses|Continuation]]), and OnDenied ([[Impulses|Continuation]]) impulses. Default to 0 if request has not been sent, or terminaed by an error described in OnError section.


=== Content ([[Type:String|String]]) ===
=== Content ([[Type:String|String]]) ===


The response that the server gave if it was a string. This only exists during the OnResponse ([[Impulses|Continuation]]) impulse.
The response that the server gave, or message of the thrown exception during HTTP request. This only exists during the OnResponse ([[Impulses|Continuation]]) impulse.




[[Category:ProtoFlux:Networking]]
[[Category:ProtoFlux:Network]]

Latest revision as of 14:40, 28 April 2024

GET String
*
OnSent
URL
OnResponse
OnError
OnDenied
StatusCode
Content
Network

GET String sends a HTTP request with GET method on call and decode its content with given charset in the Content-Type header (See MDN to obtain more info about the header). Defaults to UTF-8 if charset is not present in the header, or the header itself does not exist.

Authorization - i.e. via BasicAuth - is currently not supported.

This is not suitable for binary-transmission, as this node decodes the whole response as a human-readable string. Consider using one of the Asset Providers if your intention is fetching remote assets such as Texture2D.
This node is best used with an impulse from the client actually wanting to fulfill the data transfer task. See Security/Consent and surrounding info.

Inputs

* (AsyncCall)

Trigger to send a get request to the URL (Uri) server location

URL (Uri)

The server location to send the get request to.

Outputs

OnSent (AsyncCall)

Fires immediately after the request is sent, so multiple async functions can happen in parallel.

OnResponse (Continuation)

Fires after the server has responded with either (TODO: Which responses are valid?) HTTP code and sent a string based response. The node will output these to their respective outputs during this pulse.

OnError (Continuation)

Fires after the HTTP client concludes that the request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout.

OnDenied (Continuation)

Fires after the user processing the request denied access request prompt to the Uri host, or denied by their setting. Please see external connection page for more information.

StatusCode (HTTP Status Code)

The code that the server responded with, no matter if it failed, was denied, succeeded at a response, or returned an error. This only exists during the OnResponse (Continuation), OnError (Continuation), and OnDenied (Continuation) impulses. Default to 0 if request has not been sent, or terminaed by an error described in OnError section.

Content (String)

The response that the server gave, or message of the thrown exception during HTTP request. This only exists during the OnResponse (Continuation) impulse.