I am trying to move to HTTP binding vs just running my API queries in a script.
I have a script:
and as you can see, it is a success and returns data. But, I can't seem to get my HTTP binding to give me the same results.
I know the API works from the script, but I can't seem to get the bindings to work. Also, there is no API documentation to look up.
I know its something real simple, but I cant seem to figure it out.
I'm not certain, but I believe you'll need to do something to return a JSON encoded string as I suspect passing {view.custom.params}
is passing an object rather than a string. I just don't know what function you could use to convert it without passing it to a script.
The body passing should be fine, actually. The more pressing issue is that I don't see any attempt to recreate the authentication headers, which is the HTTP binding's biggest flaw - you can't really use it for stateful authentication flows, only basic static login e.g. bearer tokens (where you don't mind each session issuing potentially overlapping requests).
I would recommend continuing to use scripting, but migrating to system.net.httpClient
over httpPost
, over the HTTP binding.
1 Like
do not put passwords in perspective properties, i hope this is for demo only D:
It might be fine if the property is set to private.
That's one feature I have yet to dig in, so I'm not sure what exactly happens when you change that setting and what it entails, but from what I understand properties set to private never leave the gateway.
Not that you should store password there, clearly, but it might not be that bad