Hi-
I would like to attach an api to a table in my perspective view. When I bind a custom prop to the call, I am able to get the html version of the response. I can also get the json version of the response but I must specify this in the URL. I would like to use the headers option (example below) to add my content type and my pagination information but it's not working with the example below. There isn't any examples online on how to use the headers section, is my setup correct?
What's not working?
Getting useful answers here is going to depend on the behavior/requirements of the API you're talking to, and you have provided no documentation or information about it.
Hi Kevin!
The API is operating and validated but the problem stems from me not fully knowing what is being sent to the API. Are there debugging options within ignition to see when my API calls are made and what the information/headers I am sending over?
When I add an API that is working and open it in the browser (checking network browser properties), the API calls appear to be hidden within the perspective page request.
The API calls are made from the gateway, not the browser. You won't see them there.
You'll have to use Wireshark or some kind of proxy to actually see what's being sent.
It might help to get your headers figured out using a script and system.net.httpClient
and then set up a binding afterwards. Just a little easier to iterate on.
The system.net.httpClient helped me debug, Thanks Kevin!