Hy, I am trying to retrieve XML data from a REST API. I am trying this via the script console.
However, I am always getting a 411.
The API documents tell me to use a POST and to pass in the username and password via parameters.
For ignition I use the following:
client = system.net.httpClient(bypass_cert_validation = True) access_response = client.post(url="https://xxxx.svc/?username=xxxx&password=xxxx")
The response I get is:
>>> <Response@247370237 'https://xxxx.svc/?username=xxxx&password=xxxx' > >>>
Since the 411 means the server is looking for a content-length, I have also tried to add data="" to the httpClient method just to give it data.
I have also tried to set Content-Length to 0 in the headers but get a java error saying I can't do that.
I have been successful using POSTMAN to post to this server.