OAuth1WebClient (FB)ΒΆ
FUNCTION_BLOCK OAuth1WebClient
Function block to a send an oAuth1 request.
- InOut:
Scope
Name
Type
Initial
Comment
Input
xExecuteBOOLRising edge: Send request
udiTimeOutUDINTTimeout in micro seconds
sURLSTRING(1024)URL of the web server
eRequestTypeREQUEST_TYPE.GET
Type of the request: POST or GET
eContentTypeCONTENT_TYPE.APPLICATION_FORM
HTTP Content-Type of the request
pwsAdditionalHeaderPOINTER TO WSTRING
Additional HTTP header
pwsPostValuePOINTER TO WSTRING
Post parameter
xCloseConnectionBOOLFALSE
Close the connection after each request.
sOAuthConsumerKeySTRING(255)OAuth1: Consumer key
sOAuthTokenSTRING(255)OAuth1: Token
sConsumerSecretSTRING(255)OAuth1: Consumer secret
sOAuthTokenSecretSTRING(255)OAuth1: Token secret
itfTLSContextNBS.ITLSContext0
Encapsulates all the data neccecray to handle encrypted tcp connections
Static initialization, as shown in the following code snippet.
VAR commonName : STRING := 'MyRrasPi'; ciCertInfo : NBS.CERT_INFO := (psInfo:=ADR(commonName), udiSize:=LEN(commonName)); myTLSContext : NBS.TLSContext := ( ePurpose:=NBS.PURPOSE.CLIENT_SIDE, sUseCaseName:='NBSTest', sTLSVersion:='1.3', ciCertInfo:=ciCertInfo, udiVerificationMode:=2 ); END_VAR
itfAsyncPropertyNBS.IAsyncProperty0
Runs the connect process in a own background task, usage see library Net Base Services
Output
xDoneBOOLxBusyBOOLxErrorBOOLeErrorCurrent error state
httpResultThe result of the request