Skip to content
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

RFE: a way to easily parameterize API fns requiring token to "bake in" the token #2

Open
jeremy-w opened this issue Jun 21, 2013 · 2 comments

Comments

@jeremy-w
Copy link

It seems like a way to parameterize the token-requiring parts so you can call them with the token as an intrinsic part would be pretty nifty.

@jeremyheiler
Copy link
Owner

I agree that this would be nice to have. It can be done with a with-token macro that binds the token to a dynamic thread-local var. Then the internal paprika.http/api-request function can insert it if one is not provided via the options map.

(paprika.core/with-token "TOKEN"
  ;; any code that calls paprika.core functions
  (paprika.core/create-post "Yeah!"))

I've mainly avoided this from the start so that I could make sure the API works well with out it. But now that I have an API that I like, it does make sense to add this. Thank you.

@jeremyheiler
Copy link
Owner

I also want to consider other possible "global" information such as API version and the URI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants