Hey Bruno,

Sorry for the delay, very busy.

Also, sorry that the documentation for DSpace 5 REST API isn't complete
yet. Feel free to contribute as you discover how things work.


It looks like you need to first create the item, as you are currently doing
it:
POST /collections/{collectionID}/items

(Don't post the bitstream, only the item metadata is respected, item
bitstream is ignored)

That returns you an Item, and (including its ID).

Then, you can pass the data of your file to
POST /items/{itemID}/bitstreams

Reading the code might be necessary, until the documentation is fully
comprehensive.
https://github.com/DSpace/DSpace/blob/master/dspace-rest/src/main/java/org/dspace/rest/ItemsResource.java#L411

________________
Peter Dietz
Longsight
www.longsight.com
[email protected]
p: 740-599-5005 x809

On Mon, Jan 12, 2015 at 7:36 AM, Bruno Zanette <[email protected]>
wrote:

> anyone?
>
> 2015-01-09 12:35 GMT-02:00 Bruno Zanette <[email protected]>:
> > Hi, I'm trying to upload files via REST-API but it is not working.
> >
> > In the way i'm doing the requests the items are being successfully
> > created but without any file.
> >
> > To do the tests i'm using Curl with the following options:
> >
> > curl -v -k -i -4 \
> >   -H "Content-Type: application/zip" \
> >   -H "rest-dspace-token: " \
> >   -X POST https://localhost:8443/rest/collections/1/items \
> >   [email protected]
> >
> > The content of file "request.xml" is the end of the message. I wrote
> > it based on the result of a GET_ITEM request of an item submitted via
> > XMLUI API.
> >
> >  I'm using Dspace-master branch (5.0 Rc3), installed of Ubuntu 14.04.
> >
> > Does anyone knows how to do it?
> > Am I doing the request correctly?
> > Any tips?
> >
> > I've already tried to send zip files but it fails with a message of
> > "Unsupported media type"...
> >
> > Thanks!
> >
> >
> --------------------------------------------------------------------------------
> > <item>
> > <name>TITLE</name>
> > <type>item</type>
> > <archived>true</archived>
> >
> > <bitstreams>
> > <id>1</id>
> > <name>servicedocument</name>
> > <type>bitstream</type>
> > <bundleName>ORIGINAL</bundleName>
> > <checkSum
> checkSumAlgorithm="MD5">63634883c3cc2b837895c3b8bda9e815</checkSum>
> > <description>SERVICE_DOCUMENT</description>
> > <format>Unknown</format>
> > <mimeType>application/octet-stream</mimeType>
> > <retrieveLink>/bitstreams/1/retrieve</retrieveLink>
> > <sequenceId>1</sequenceId>
> > <sizeBytes>2758</sizeBytes>
> > </bitstreams>
> >
> > <lastModified>2015-01-08 14:54:48.816</lastModified>
> > <metadata><key>dc.contributor.author</key><value>ULTIMO,
> > PRIMEIRO</value></metadata>
> > <metadata><key>dc.date.issued</key><value>1234-12-12</value></metadata>
> >
> <metadata><key>dc.identifier.citation</key><language>pt_BR</language><value>CITATION</value></metadata>
> >
> <metadata><key>dc.description</key><language>pt_BR</language><value>DESCRICAO</value></metadata>
> >
> <metadata><key>dc.description.abstract</key><language>pt_BR</language><value>ABSTRACT</value></metadata>
> >
> <metadata><key>dc.language.iso</key><language>pt_BR</language><value>pt_BR</value></metadata>
> >
> <metadata><key>dc.publisher</key><language>pt_BR</language><value>PUBLISHER</value></metadata>
> >
> <metadata><key>dc.title</key><language>pt_BR</language><value>TITULO</value></metadata>
> >
> <metadata><key>dc.title.alternative</key><language>pt_BR</language><value>OUTROS_TITULOS</value></metadata>
> >
> <metadata><key>dc.type</key><language>pt_BR</language><value>Dataset</value></metadata>
> > <withdrawn>false</withdrawn>
> > </item>
> >
> --------------------------------------------------------------------------------
> > --
> > Bruno Nocera Zanette
> > +55 41 9992-2508
>
>
>
> --
> Bruno Nocera Zanette
> +55 41 9992-2508
>
>
> ------------------------------------------------------------------------------
> New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
> GigeNET is offering a free month of service with a new server in Ashburn.
> Choose from 2 high performing configs, both with 100TB of bandwidth.
> Higher redundancy.Lower latency.Increased capacity.Completely compliant.
> vanity: www.gigenet.com
> _______________________________________________
> DSpace-tech mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/dspace-tech
> List Etiquette:
> https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
>
------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette

Reply via email to