IHttpClient
- Namespace
- ZCore
- Extends
- Inherited Properties
- Inherited Methods
INTERFACE IHttpClient EXTENDS ZCore.IObject, ZCore.IError
Used to send HTTP requests and receiving HTTP responses from a resource identified by a URI.
Properties
StatusCode
PROPERTY StatusCode : HttpClientStatusCode
This property returns the statuscode of a server's response. The value is only valid if Busy=FALSE.
Property Value
Methods
GetAsync
METHOD GetAsync (
[input] startToken : IStartToken,
[input] uri : STRING(ParameterList.MaxHttpClientUriLength),
[input] responseBuffer : ZPointer,
[input] responseSize : UDINT)
Send a GET request to the specified Uri as an asynchronous operation.
Use Busy property and its derivatives to retrieve the status of the asynchronous operation.
As soon as Busy=FALSE the StatusCode method can be used to check
if the request was successful (StatusCode=200) or not. The response of the GET request is written to the
responseBuffer, which is passed as a parameter to this method. Make sure that the buffer size is big enough
for the response, which is returned by the server.
Inputs
startTokenIStartTokenuriSTRING(ParameterList.MaxHttpClientUriLength)responseBufferZPointerresponseSizeUDINT
PostAsync
METHOD PostAsync (
[input] startToken : IStartToken,
[input] uri : STRING(ParameterList.MaxHttpClientUriLength),
[input] payloadBuffer : ZPointer,
[input] payloadSize : UDINT)
Send a POST request to the specified Uri as an asynchronous operation.
Use Busy property and its derivatives to retrieve the status of the asynchronous operation.
As soon as Busy=FALSE the StatusCode method can be used to check
if the request was successful (StatusCode=200) or not. The payload that should be send to the server is is passed as a parameter to this method.
Inputs
startTokenIStartTokenuriSTRING(ParameterList.MaxHttpClientUriLength)payloadBufferZPointerpayloadSizeUDINT
SetHttpClientProxy
METHOD SetHttpClientProxy (
[input] on : BOOL,
[input] target : STRING)
This method is used to set a server, which acts as a proxy for the PLC. Refer to the implementation to get more details about this.