Ah, it seems the `/rest/items/find-by-metadata-field` endpoint doesn't
exist in DSpace 4.x. Neither does the `/rest/login` endpoint. The docs need
to make more of a point to say which versions these are supposed to work
in... ;)

Alan

On Thu, Jun 11, 2015 at 12:24 PM Alan Orth <alan.o...@gmail.com> wrote:

> Thanks. It seems my query is well formed but it returns an "HTTP 405
> Method Not Allowed" response. Perhaps DSpace 4.x's REST API isn't
> sufficient for the find-by-metadata-field query. Or perhaps I need to log
> in as you illustrated here:
>
> https://github.com/BrunoNZ/dspace-rest-requests
>
> I guess I'll fork that repo and give this a more structured test. I
> already found some syntax and usability bugs there (mixing sh and bash, not
> reading the sourced variables, etc).
>
> Alan
>
> On Wed, Jun 10, 2015 at 8:30 PM, Bruno Zanette <brunonzane...@gmail.com>
> wrote:
>
>> Hey Alan,
>> Take a look at the commentaries on the REST-API's documentation's page.
>> I've answered a similar question there.
>>
>> https://wiki.duraspace.org/display/DSDOC5x/REST+API?focusedCommentId=68068154#comment-68068154
>>
>> But basically, the request that you have to send is something like this:
>> curl -k -4 -H "accept: application/json" -H "Content-Type:
>> application/json" -X POST "
>> https://demo.dspace.org/rest/items/find-by-metadata-field"; -d '{"key":
>> "dc.title","value": "Test Webpage","language": "en_US"}'
>>
>> Em qua, 10 de jun de 2015 às 14:08, Alan Orth <alan.o...@gmail.com>
>> escreveu:
>>
>>> Hey,
>>>
>>> I'm using DSpace 4.3 and trying to search for items matching certain
>>> metadata. The REST API docs on GitHub[0] mention that you can POST to
>>> `rest/items/find-by-metadata-field`, but it doesn't give any more
>>> information than that (like how to specify query parameters).
>>>
>>> I've tried several variations of the following:
>>>
>>> $ http --print Hhb POST '
>>> http://localhost:8080/rest/items/find-by-metadata-field'
>>> dc.subject="LACTATION"
>>>
>>> It always returns with an HTTP 405. What is the proper way to use this?
>>> Does the POST require I login first or something?
>>>
>>> Thanks,
>>>
>>> [0] https://github.com/DSpace/DSpace/tree/master/dspace-rest
>>>
>>> --
>>> Alan Orth
>>> alan.o...@gmail.com
>>> https://alaninkenya.org
>>> https://mjanja.ch
>>> "In heaven all the interesting people are missing." -Friedrich Nietzsche
>>> GPG public key ID: 0x8cb0d0acb5cd81ec209c6cdfbd1a0e09c2f836c0
>>>
>>> ------------------------------------------------------------------------------
>>> _______________________________________________
>>> DSpace-tech mailing list
>>> DSpace-tech@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/dspace-tech
>>> List Etiquette:
>>> https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
>>
>>
>
>
> --
> Alan Orth
> alan.o...@gmail.com
> https://alaninkenya.org
> https://mjanja.ch
> "In heaven all the interesting people are missing." -Friedrich Nietzsche
> GPG public key ID: 0x8cb0d0acb5cd81ec209c6cdfbd1a0e09c2f836c0
>
------------------------------------------------------------------------------
_______________________________________________
DSpace-tech mailing list
DSpace-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette

Reply via email to