Conversation
|
@cschramm I agree, that would be quite useful! But I have to say, I don't like the fact to expose the oauth-gem specific arguments to the user very much. That will basically result in What do you think about something like |
|
I get your thoughts about the double options hash, but I simply would not call the parameters options and there's nothing wrong with What improvement does your first suggestion provide? The second suggestion would be pretty nice to use and the possible conflicts are absolutely unlikely, but in any case it has a theoretical flaw... |
|
Well, my first suggestion would be at least a little bit more in line with what other libraries like typhoeus are doing. Also, having to different option hashes as the last method arguments - even though it's not pretty - is not that uncommon in rails-land (see for instance http://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#method-i-link_to). |
|
a) POST and PUT: I probably got the wrong idea of why that call (a) feels rubbish to you. I thought you meant the two hashes, but you probably mean that a body argument is required to specify headers for POST and PUT requests, as it is the case in the oauth gem. That's of course improved in your first suggestion (b). It may be a counter-argument that this interface is new to users who are already familiar with oauth's and that the implementation will get a little ugly since the semantics of the arguments depend on Anyway, here's an implementation for (b): cschramm@8344794 But for the mentioned reasons I like (a). What I'd like best is (c). We could check if options includes any of the three keys and fall back to the previous behavior otherwise. That would make it 'practically backward-compatible'. |
|
You're right, (c) sounds like the best solution and fallback to the previous implementation if none of |
There are at least vendor resources where you need to set a body. Headers may also be useful.