Http bindings aren’t going to work well for this purpose - they’re not very good at authentication right now.
I’d recommend system.net.httpClient(). You could wrap things in a class to make accessing the API a little friendlier:
How would you use this in perspective to show live status of containers(?):
I am thinking a gateway event timer script. Then write to a dataset tag. But then the script would init every time, which is unnecessary since the token is valid for 8 hours?
Parallel to the status being updated. If I make buttons in perspective to start/stop containers. Should I run this script directly, or use the already obtained token. In the latter case I must store the token somewhere; normal tag database, or session custom props?
Try setting a -Djdk.httpclient.maxframesize=524288 in the JVM arguments of wherever you’re running the http client - if it’s on the gateway, it’ll be in ignition.conf, in the wrapper.java.additional parameters section.
In the JVM arguments of the designer launcher configuration - the same argument without the wrapper.java.additional; the entire remainder of the line starting with -D should do it.