Add support for raw blob responses #18

Merged
merged 1 commit into from Dec 19, 2012

2 participants

@danburkert

To receive a blob in raw format from, add

 {:accept "application/vnd.github.beta.raw"}

to the data/blob options map.

@Raynes Raynes commented on an outdated diff Dec 19, 2012
src/tentacles/core.clj
@@ -32,13 +32,16 @@
(defn safe-parse
"Takes a response and checks for certain status codes. If 204, return nil.
- If 400, 422, 404, 204, or 500, return the original response with the body parsed
- as json. Otherwise, parse and return the body."
+ If 400, 422, 404, 204, or 500, return the original response with the body parsed
+ as json. Otherwise, parse and return the body if json, or return the body if raw."
@Raynes
Owner
Raynes added a line comment Dec 19, 2012

Not a big deal, but do you think you could indent this docstring back the way it was? I've got nothing against this style, just that it isn't consistent with the rest of the library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@danburkert danburkert Add support for raw blob responses
To receive a blob in raw format from, add
    {:accept "application/vnd.github.beta.raw"}
to the data/blob options map.
993fd19
@danburkert

Fixed the comment indent issue

@Raynes
Owner

Excellent! Thanks!

@Raynes Raynes merged commit 05876e5 into Raynes:master Dec 19, 2012
@danburkert danburkert deleted the danburkert:raw-blob branch Dec 19, 2012
@danburkert

Glad to do it, thanks for being so prompt.

@Raynes
Owner

Don't get used to it, I'm usually lazy.

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