OAuth1WebClient (FB)ΒΆ

FUNCTION_BLOCK OAuth1WebClient

Function block to a send an oAuth1 request.

InOut:

Scope

Name

Type

Initial

Comment

Input

xExecute

BOOL

Rising edge: Send request

udiTimeOut

UDINT

Timeout in micro seconds

sURL

STRING(1024)

URL of the web server

eRequestType

REQUEST_TYPE

REQUEST_TYPE.GET

Type of the request: POST or GET

eContentType

CONTENT_TYPE

CONTENT_TYPE.APPLICATION_FORM

HTTP Content-Type of the request

pwsAdditionalHeader

POINTER TO WSTRING

Additional HTTP header

pwsPostValue

POINTER TO WSTRING

Post parameter

xCloseConnection

BOOL

FALSE

Close the connection after each request.

sOAuthConsumerKey

STRING(255)

OAuth1: Consumer key

sOAuthToken

STRING(255)

OAuth1: Token

sConsumerSecret

STRING(255)

OAuth1: Consumer secret

sOAuthTokenSecret

STRING(255)

OAuth1: Token secret

itfTLSContext

NBS.ITLSContext

0

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

itfAsyncProperty

NBS.IAsyncProperty

0

Runs the connect process in a own background task, usage see library Net Base Services

udiPostValueLength

UDINT

0

Length of pwsPostValue in bytes. udiPostValueLength = 0: The null character of pwsPostValue^ is used to calculate the content length. udiPostValueLength > 0: The specified length is used for the content length. This can be used to send binary data.

Output

xDone

BOOL

xBusy

BOOL

xError

BOOL

eError

ERROR

Current error state

httpResult

HttpResult

The result of the request