Posting to a REST service
Hello,
I come from a programming background, but haven't touched ObjectScript before my current job, so please forgive my ignorance.
Within an Ensemble system, I need to post some information to a RESTful web service. I'm just trying to figure out how to create a method which takes a simple message and posts this off to a RESTful web service?
Thanks in advance for any help.
If it's a part of Ensemble Production, you need to create Business Operation. Here's a sample BO that does POST request:
If you're outside of Ensemble, you need to use %Net.HttpRequest class. Here's an example.
Hi there,
Apologies for my late response - I had a bit of a family emergency for a while there...
Thank you for the help. I swear I'm almost there but must just be missing something. Specifically, I'm posting to ElasticSearch, and it seems to be going well, solving connectivity issues and getting past a 404 response. But I'm now getting a 400 (Bad Request) response, and I can't easily get past it... Is that something I should post more details on here, or is it worth asking a new question about that?
That may mean one of the several things:
Anyway, to solve this problem you need to make a correct request to the target system, record it and compare to the Ensemble request. Here's an article on that.