Skip to content

Dynamic path with GET request #84

Open
@jufemaiz

Description

@jufemaiz

Hi all, have a slight conundrum.

Looking at the Hyperclient::Link

https://github.com/codegram/hyperclient/blob/master/lib/hyperclient/link.rb#L84-L91

the _get call on it cannot pass any parameters as params unlike the other options (post, put, and patch)

Where get params are required it cannot be achieved.

Activity

dblock

dblock commented on Mar 18, 2015

@dblock
Collaborator

The link itself needs to be templated, then it can be constructed with parameters. You're not supposed to throw in random parameters into a get link as far as I understand. That said I would be open for allowing code to do that I think. Want to try a PR and we can discuss it around code?

jufemaiz

jufemaiz commented on Mar 25, 2015

@jufemaiz
Author

@dblock yep, I get that, however there are times when GET parameters are required - even with a RESTful approach. Will give it a crack. Cheers!

dblock

dblock commented on Aug 15, 2015

@dblock
Collaborator

@bhoggard this is what we discussed for that sort parameter, give it a shot!

dblock

dblock commented on Aug 15, 2015

@dblock
Collaborator

I took a stab at implementing this in #92 and the most efficient solution I found was to patch URITemplate. There're a few questions:

  1. I don't love it this implementation. We're no longer complying with RFC6570 so monkey-patching is not the way to go. But I don't love rewriting the whole class either.
  2. We need to be able to enable/disable this behavior. I wonder whether it needs to be per client, per URI or something else?
  3. Everything needs to be documented.
added a commit that references this issue on Aug 15, 2015

Merge pull request #93 from dblock/tests-for-templated-parameters

2 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @jufemaiz@dblock

        Issue actions

          Dynamic path with GET request · Issue #84 · codegram/hyperclient