Im using the confluence REST API in python.
Im importing html using:
def create_page @ atlassian.confluence
def create_page(self, space, title, body, parent_id=None, type='page',
representation='storage'):
The imported html contains images. How can i upload these images (or references to them as included in the confluence page) using the REST API in python? Is it enough to change the type here to multimedia, and do something like:
import os
import requests
url = 'http://host:port/endpoint'
with open(path_img, 'rb') as img:
name_img= os.path.basename(path_img)
files= {'image': (name_img,img,'multipart/form-data',{'Expires': '0'}) }
with requests.Session() as s:
r = s.post(url,files=files)
print(r.status_code)
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.