Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 3655

Getting images from same page as the content (link between /attachments and the page it is from) XWiki REST API

$
0
0

Right now I am getting content from base/spaces/abc/pages/xyz which has data['id'] from response of 'base:abc.xyz' and the image from base/spaces/abc/pages/xyz/attachments where i do

        for each in data['attachments']:             category = each['id']

which has category of 'base:abc.xyz@file.jpg'... how do I link these together right now so that when i get a page I can find the images in that page

right now I am doing

match = re.match(r'(.*?)(?<!\\)@', category)      if match:          category = match.group(1) # to get category of 'base:abc.xyz

so that the image has the same id as the id of the page it is in and then find both.

BUT i am worried this is hardcoded, is it always the case that @ WITHOUT @ separates the filetype and the parent id of the page OR is this not standard and it was just the way this specific xwiki was configured?


Viewing all articles
Browse latest Browse all 3655

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>