Dante and Luiz,
The request must be in the format:
{"key":"dc.XXX.YYY", "value":"Query"}

Example:
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"}"

Hope this helps!

Em qua, 14 de set de 2016 às 17:01, Luiz dos Santos <luiz...@gmail.com>
escreveu:

> need help + 1
>
> On Wed, Sep 14, 2016 at 3:57 PM, Dante Valencia <
> dante.valenci...@gmail.com> wrote:
>
>> Hi friends
>> I need help with understanding how to use (find-vy-metadata) with Rest
>> For example, I do this in  loggout
>>  try {
>>
>>
>>             DefaultHttpClient httpClient = new DefaultHttpClient();
>>             HttpPost postRequest = new HttpPost("
>> http://10.3.11.134:8080/rest/logout";);
>>             postRequest.addHeader("rest-dspace-token", jLabel1.getText
>> ());
>>             HttpResponse response = httpClient.execute(postRequest);
>>
>>
>>             if (response.getStatusLine().getStatusCode() != 200) {
>>                 throw new RuntimeException("Failed : HTTP error code : "
>>                         + response.getStatusLine().getStatusCode());
>>             }
>>
>>
>>             BufferedReader br = new BufferedReader(
>>                     new InputStreamReader((response.getEntity().
>> getContent())));
>>
>>
>>             String output, sout = "";
>>             while ((output = br.readLine()) != null) {
>>                 sout += output;
>>             }
>>             jLabel1.setText("Logout");
>>             httpClient.getConnectionManager().shutdown();
>>
>>
>>
>>         } catch (MalformedURLException e) {
>>
>>             e.printStackTrace();
>>
>>         } catch (IOException e) {
>>
>>             e.printStackTrace();
>>
>>         }
>>
>> or if i want the items of a collection I do this
>> try {
>>             // TODO add your handling code here:
>>             HttpClient client = new DefaultHttpClient();
>>             HttpGet request = new HttpGet("
>> http://10.3.11.134:8080/rest/collections/3/items";);
>>             request.addHeader("Content-Type", "application/json");
>>             request.addHeader("Accept", "application/json");
>>             request.addHeader("rest-dspace-token", jLabel1.getText());
>>
>>
>>             HttpResponse response = client.execute(request);
>>             BufferedReader rd = new BufferedReader(new InputStreamReader(
>> response.getEntity().getContent()));
>>             String line = "";
>>             while ((line = rd.readLine()) != null) {
>>                 System.out.println(line);
>>             }
>>         } catch (Exception ex) {
>>             System.out.println(ex);
>>         }
>>
>>
>> but I dont understand how i have to send the metadata i am looking for.
>>
>> Please I need help
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "DSpace Technical Support" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to dspace-tech+unsubscr...@googlegroups.com.
>> To post to this group, send email to dspace-tech@googlegroups.com.
>> Visit this group at https://groups.google.com/group/dspace-tech.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "DSpace Technical Support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to dspace-tech+unsubscr...@googlegroups.com.
> To post to this group, send email to dspace-tech@googlegroups.com.
> Visit this group at https://groups.google.com/group/dspace-tech.
> For more options, visit https://groups.google.com/d/optout.
>
-- 
Bruno Nocera Zanette
+55 41 9992-2508

-- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dspace-tech+unsubscr...@googlegroups.com.
To post to this group, send email to dspace-tech@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.

Reply via email to