Table of Contents

IHttpClient

Namespace
ZCore

Used to send HTTP requests and receiving HTTP responses from a resource identified by a URI.

INTERFACE IHttpClient EXTENDS ZCore.IObject, ZCore.IError
Extends
Inherited Properties
Inherited Methods

Properties

StatusCode

This property returns the statuscode of a server's response. The value is only valid if Busy=FALSE.

PROPERTY StatusCode : HttpClientStatusCode

Property Value

HttpClientStatusCode

Methods

GetAsync

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.

METHOD GetAsync (
 startToken : IStartToken,
 uri : STRING(ParameterList.MaxHttpClientUriLength),
 responseBuffer : ZPointer,
 responseSize : UDINT)

Inputs

startToken IStartToken

uri STRING(ParameterList.MaxHttpClientUriLength)

responseBuffer ZPointer

responseSize UDINT

PostAsync

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.

METHOD PostAsync (
 startToken : IStartToken,
 uri : STRING(ParameterList.MaxHttpClientUriLength),
 payloadBuffer : ZPointer,
 payloadSize : UDINT)

Inputs

startToken IStartToken

uri STRING(ParameterList.MaxHttpClientUriLength)

payloadBuffer ZPointer

payloadSize UDINT

SetHttpClientProxy

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.

METHOD SetHttpClientProxy (
 on : BOOL,
 target : STRING)

Inputs

on BOOL

Use proxy (on:=TRUE) or try to use native mode (on:=FALSE)

target STRING