This how-to shows what is needed to invoke JSON-based web services using Zato, which is a Python-based ESB for SOA, cloud integrations and backend services.
SHOW ME THE CODE
This is the code needed:
Read below for the whole story.
SWAPPABLE ENDPOINTS Everything in Zato is about reusability. No information is ever hard-coded hence you don't access any particular addresses directly. Your own services use reusable outgoing connections that are created using the GUI, CLI, API or en masse from config files.
Thus, the code above is simply concerned with producing request and handling response but not with trivialities such as endpoint addresses.
You don't need to code security either - this is added automatically, if needed, by the platform.
For the curious one - HTTP endpoints are based on top of the excellent requests library and you can always access the underlying connection directly if it's needed.
CREATING AN OUTGOING CONNECTION IN GUI
No restarts are needed. Everything is hot-reconfigured.
And that's all there is to it.
Likewise, should you in future need to update an existing definition, this can be done with restarts, by merely filling a form, with no code changes.