Notes
Get raw file data from Github API
getting raw file contents from the GitHub API with HTTPie by sending an Accept header of application/vnd.github.v3.raw.
APIs
You can use the send an Accept hedaer with the conent-type you want with your http requests. Many APIs allow you to request the same resource in different content-types.
// Content-Type: application/vnd.github.v3.raw
http -v get https://api.github.com/gitignore/Node Accept:application/vnd.github.v3.raw
Notes
- If you ask for an unsupported media/content type, you’ll get a
415: Unsupported Media Typeerror - Response code 200s: success
- Response code 300s: location is elsewhere (or already in cache i.e. 307)