adding test script

parent d6fe40e5
require_relative 'lib/dspace'
require 'faraday'
faraday ='', {ssl: {verify: false}, headers: {content_type: 'application/json',
accept: 'application/json'}})
client = '')
r = faraday)
\ No newline at end of file
#if !client.is_running?
# raise 'Can\'t connect to DSpace API.'
client.login '', 'dspace'
my_bitstream = client.bitstreams.find(id: 47) = 'update_bitstream.jpg'
client.bitstreams.update(my_bitstream, id: 47)
#faraday = client.connection
#file ='/Users/mauriciogirardello/Pictures/Celular/IMG_20130616_171009.jpg', 'r')
#p client.items.add_bitstream(file, id: 11, name: 'nova_foto.jpg', description: 'testando upload')
#p '/rest/items/11/bitstreams?name=foto.jpg', Base64.encode64( do |r|
# r.headers['Content-Type'] = 'image/jpeg'
#end"file.txt", "text/plain")
#file_io ='/Users/mauriciogirardello/Workspace/c3sl/dspace-rest-client/')
#file =, "text/plain", "file.txt")
#p client.items.add_bitstream"/Users/mauriciogirardello/Workspace/c3sl/dspace-rest-client/", "text/plain"), id: 4, name: ''
\ No newline at end of file
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