collectionQuery
collectionQuery
query on DAVCollection
const result = await collectionQuery({
url: 'https://contacts.icloud.com/123456/carddavhome/card/',
body: {
'addressbook-query': {
_attributes: getDAVAttribute([DAVNamespace.CARDDAV, DAVNamespace.DAV]),
[`${DAVNamespaceShort.DAV}:prop`]: props,
filter: {
'prop-filter': {
_attributes: {
name: 'FN',
},
},
},
},
},
defaultNamespace: DAVNamespaceShort.CARDDAV,
depth: '1',
headers: {
authorization: 'Basic x0C9uFWd9Vz8OwS0DEAtkAlj',
},
});
Arguments
url
required, collection urlbody
required, query request bodydepth
DAVDepthdefaultNamespace
defaults toDAVNamespaceShort.DAV
, default namespace for the the request bodyheaders
request headersheadersToExclude
array of keys of the headers you want to excludefetchOptions
options to pass to underlying fetch function
Return Value
array of DAVResponse
Behavior
send REPORT request on the target collection, parse response xml into array of DAVResponse