-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add HttpPoster (#460) #462
Conversation
8ff88ab
to
9b6d5ba
Compare
- refactor
9b6d5ba
to
dcff44e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make (more) sense to just extend the HttpOpener
with more options? (request method, request body, response code range [although I'm a bit hesitant about transporting both success and error data over the same channel, without any means of differentiating them], etc.)
Why you don't like it?
Ok. What's your proposal? Just passing an empty response and an throwing an Exception? |
But then you'd have to introduce new classes (and Flux commands) for every other verb we'd like to support ( Although I realise that Maybe we could introduce a placeholder for the input data, e.g.
I don't really have one right now. Maybe something akin to what we're doing in Fix functions: Let the user control the error case, e.g. with a prefix (that can have a default in this case). |
But I like that, because these commands are soo self explaining (and documentation (i.e. usability) is one of our weaknesses). Many parameters make things so complicated (in my view). Hm,hm. Maybe you have point. So this boils down to have only one class: But then, what if we have other classes making use of URLConnection, like https://github.com/linked-swissbib/swissbib-metafacture-commands/blob/master/src/main/java/org/swissbib/linked/mf/source/MultiHttpOpener.java (I guess we could do this reusing [edit: when using other protocols then |
That's hard to argue with. With great flexibility comes great responsibility ;) But then again, we'd have a unified interface instead of different classes with different behaviour and options.
I'm not sure I follow. If you can subclass |
Not to rain on your parade, but this is the direction I had in mind: 3f7e150. Maybe this helps to further the discussion. |
If you think that's the way to go, then yes. But it wasn't my intention to kill the discussion here; you had a valid point with "multiple simple commands" vs. "one complex command". I just wanted to illustrate my point of view. |
Superseded by #463. |
Supersedes #461.