Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi, I just took a look at octokit tonight and I really like it. I don't see an obvious way to deal with Github's conditional requests, so I'm making a stab at implementing this myself. Let me know if you have some suggestions for how you'd rather this work.
I added a section to the README for how this works. I tried to implement this so that it has no big changes to the style of the API.
Basically, any API request has an
options
hash parameter, and I made it so that passing:since
or:etag
will apply its value to theIf-Modified-Since
orIf-None-Match
request headers, respectively.Then once the request is finished, and since it's a synchronous request, then the client will have two attributes,
last_modified
andetag
, which may be read for the next time this request is made.