Adds support for conditional requests and new way of checking rate limits #23

merged 2 commits into from Apr 16, 2013


None yet
3 participants

ngrunwald commented Feb 2, 2013

This patch changed adds support for making conditional HTTP requests to the API, and introduces a new way to check rate-limits. I switched from merging the keys directly into the response to supplying them under a certain meta key because the merge policy was problematic for the API routes that returned vectors and not a map.
When returning a lazy seq, metadata cannot be maintained on the response itself so this patch adds on each object of the seq the metadata that corresponds to the request with which it was received.


Raynes commented Feb 3, 2013

Ugh. I didn't know it was broken with vectors. I haven't used new versions recently. I'm definitely interested in this, just please give me a couple of days to look over it. I'm moving to California in the morning and such, so it's really busy at the moment.


ngrunwald commented Feb 3, 2013

Of course, take your time. Also, I'm not completely sold on the names used for the returned meta and the api-meta function, so feel free to change them.


arohner commented Mar 11, 2013

I prefer this PR over the one that's currently in master, but it still has issues. Namely, tentacles.users/emails returns a vector of strings, which safe-parse chokes on, because it assumes each item in the vector implements IObj.

If the metadata is constant, why add it to each item, rather than the returned vector?


Raynes commented Mar 11, 2013

I forgot all about this issue in the chaos. I'll take a look asap.


ngrunwald commented Mar 12, 2013

The problem is that I don't think you can hang metadata on the returned lazy-seq (not a vector). Also, when the lazy-seq paginates, the metadata is actually changing for each batch of results. Not sure how to handle the seq of Strings, but I could at least handle the error. I'll modify the PR, and see if I can find something better.

Raynes merged commit 64dc5f2 into Raynes:master Apr 16, 2013


Raynes commented Apr 16, 2013

I'm going to work off of this and see if I can fix it tonight.

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