Hello/Hi/Greetings,
New to this but I am trying to use the rest API to upload and image from a python script.
api_url = "http:/localhost/ws.php?format=json"
api_url_album ="http://localhost/ws.php?format=json&method=pwg.categories.add"
api_url_group = "http://localhost/ws.php?format=json&method=pwg.groups.add"
api_url_addphoto = "http://localhost/ws.php?format=json&method=pwg.images.addSimple"
payload = { "method": "pwg.session.login", "username": "user", "password": "password" }
def main():
session = requests.Session()
response = session.post(api_url, payload)
print( str( response) )
print( str( response.text ) )
response = session.post(api_url_addphoto, { 'category': '1', 'image': 'home/imagetest/test.png'})
print( str( response ) )
print( str( response.text ) )
Piwigo version:
PHP version:
MySQL version:
Piwigo URL: http://
Offline