You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Bastion fluent-build has a method, thenDo() which takes a Callback function object which gets executed after the request is performed. Now that Bastion has been active for quite a while, it seems this method is not really being used for anything and could be removed for our initial release. Remember that if someone wants to do something after a request, they can just type out their code as normal after the Bastion.request()...call() statement.
Alternatively, we can also change the concept into something like a withPlugins() method which takes a series of Plugin objects. This let's you configure how Bastion performs the request and what to do when it receives a response. A use-case I can think of, which is available in other REST libraries, would be something like a CookieHandler which automatically sets new cookies in the response into Bastion's globals().
The text was updated successfully, but these errors were encountered:
And then we could even have something in the Basion Configuration for Plugins. So, for example, if you plan on performing multiple requests which need to handle cookies, then you could do something like Bastion.plugins().add(new CookieHandler()) and it would apply to all Bastion requests.
KPull
changed the title
Remove the thenDo() fluent-build method
Remove the thenDo() fluent-builder method
Jan 9, 2017
KPull
added a commit
to KPull/Bastion
that referenced
this issue
Jan 23, 2017
The Bastion fluent-build has a method,
thenDo()
which takes aCallback
function object which gets executed after the request is performed. Now that Bastion has been active for quite a while, it seems this method is not really being used for anything and could be removed for our initial release. Remember that if someone wants to do something after a request, they can just type out their code as normal after theBastion.request()...call()
statement.Alternatively, we can also change the concept into something like a
withPlugins()
method which takes a series ofPlugin
objects. This let's you configure how Bastion performs the request and what to do when it receives a response. A use-case I can think of, which is available in other REST libraries, would be something like aCookieHandler
which automatically sets new cookies in the response into Bastion'sglobals()
.The text was updated successfully, but these errors were encountered: