DigestAuthWebClient (FB)¶
FUNCTION_BLOCK DigestAuthWebClient EXTENDS CBM.ETrigTo
Webclient for digest authentification, MD5 and SHA-256 available
- InOut:
Scope
Name
Type
Initial
Comment
Inherited from
Input
xExecuteBOOLRising edge: Action startsFalling edge: Resets outputsIf a falling edge occurs before the function block has completed its action, the outputs operate in the usual manner and are only reset if either the action is completed or in the event of an error. In this case, the corresponding output values (xDone,xError) are present at the outputs for exactly one cycle.ETrigTo
udiTimeOutUDINTDefines the time (µs) after which an FB (e.g. requiring an external acknowledgement) aborts operation due to a timeout with error message.
ETrigTo
Output
xDoneBOOLTRUE: Action successfully completedETrigTo
xBusyBOOLTRUE: Function block activeETrigTo
xErrorBOOLTRUE: Error occurred, function block aborts actionFALSE: No errorETrigTo
Input
wsLoginWSTRING(255)Login name
wsPasswordWSTRING(255)Password
sURLSTRING(1024)URL of the web server
eRequestTypeREQUEST_TYPE.GET
Type of the request:
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.
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
eErrorCurrent error state
httpResultThe result of the request
Methods:
Structure: