adding upload features for bitstreams

parent 79ff2c52
......@@ -52,10 +52,10 @@ module Dspace
handler(200, 201) { |response| true }
end
# action :update_data, 'PUT /rest/bitstreams/:id/data' do
# body { |object| JSON.generate(object.to_h) }
# handler(200, 201) { |response| true }
# end
action :update_data, 'PUT /rest/bitstreams/:id/data' do
body { |upload_io| upload_io }
handler(200, 201) { |response| true }
end
end
......
......@@ -50,8 +50,9 @@ module Dspace
end
action :add_bitstream, 'POST /rest/items/:id/bitstreams' do
body { |object| JSON.generate(object.to_h) }
handler(200, 201) { |response| true }
query_keys :name, :description
body { |upload_io| upload_io }
handler(200) { |response| Dspace::Bitstream.new(JSON.parse(response.body)) }
end
action :update_metadata, 'PUT /rest/items/:id/metadata' do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment