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

Content type :binary, "application/octet-stream" not available #744

Closed
akabraham opened this issue Aug 28, 2014 · 2 comments
Closed

Content type :binary, "application/octet-stream" not available #744

akabraham opened this issue Aug 28, 2014 · 2 comments

Comments

@akabraham
Copy link
Contributor

In your source code (lib/grape/util/content_types.rb) you specify the following content_types:

  :xml,  'application/xml',
  :serializable_hash, 'application/json',
  :json, 'application/json',
  :jsonapi, 'application/vnd.api+json',
  :atom, 'application/atom+xml',
  :rss,  'application/rss+xml',
  :txt,  'text/plain',

Why is there no "application/octet-stream"? It is the preferred content type for binary data.

Could you please add :binary, 'application/octet-stream' to the list here? Thanks

@akabraham
Copy link
Contributor Author

Opened #745 to solve this

@dblock
Copy link
Member

dblock commented Aug 29, 2014

You can dynamically add content types.

class API < Grape::API
    content_type :binary, 'application/octet-stream'

    get do
      content_type 'application/octet-stream'
    end
end

@dblock dblock closed this as completed Aug 29, 2014
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