On Thu, Apr 11, 2019 at 07:52:24PM -0700, euler wrote: > I have a list of item IDs with their number of downloads that I copied to a > Google spreadsheet. Previously, I am using the ImportJSON > <https://github.com/bradjasper/ImportJSON> script to parse the JSON data > but lately, due to the number of cells using this function and I have > shared my spreadsheet to a number of people, I am receiving errors that I > reached the quota for urlFetch service. As an alternative, I would like to > use the function IMPORTXML of Google spreadsheet to parse the data that I > get from the REST API. Using the browser to view for example this sample > item from DSpace demo site: > https://demo.dspace.org/rest/items/da894445-f8b1-445d-a83b-322b12facde8, it > is giving me an XML output. But if I use it in the spreadsheet, it says > "Imported > Xml content can not be parsed." Using the IMPORTDATA function with the same > url, it shows that the format is in JSON. Please see the sample spreadsheet > that I made here: Sample spreadsheet > <https://docs.google.com/spreadsheets/d/1patMBs_8PmiFYxWt3nMUQ-4IAaWI4JeVNnmRU7ZBBjs/edit?usp=sharing>. > > My question now is if there is a special request parameters for REST to > force it to send data as XML? Just like in SOLR where you can add > "&wt=json" for JSON data and "&wt=xml" for XML data.
You can add the HTTP header "Accept: application/xml" if you have some
way to do it. That may be difficult in a browser, but:
curl -H "Accept: application/xml" \
https://demo.dspace.org/rest/items/da894445-f8b1-445d-a83b-322b12facde8
yields an XML document. There are plugins for some browsers which
allow you to set headers.
--
Mark H. Wood
Lead Technology Analyst
University Library
Indiana University - Purdue University Indianapolis
755 W. Michigan Street
Indianapolis, IN 46202
317-274-0749
www.ulib.iupui.edu
--
All messages to this mailing list should adhere to the DuraSpace Code of
Conduct: https://duraspace.org/about/policies/code-of-conduct/
---
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.
signature.asc
Description: PGP signature
