1

I have a JOOMLA 3 system with Community Builder plugin. I need to update Users from a CSV file regurarly from a script. Here is the code I have tried:

if __name__ == "__main__": s = fn_login() r = s.get(cb_users) print(r) with open(IMPORT_FILE, 'rb') as f: files = {'files': f} r = s.post(post_url, files=files) 

The session (s variable) is working ok, so it is established and kept. I have tried to figure out the import POST message, but something may be missing. Nothing happens when I send the post. I have got response 200. What else do I need to consider? Do I need to add something extra from the header? Nevertheless, I am not sending any header. Do I need to send something? Do I need to send any token?

Here is the request header I got from the Google Chrome / Network (it is the only post message when I run Import from CB):

curl 'https://3joomla.domain/administrator/index.php' -X 'POST' -H 'authority: 3joomla.domain' -H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9' -H 'accept-language: en-US,en;q=0.9,hu;q=0.8' -H 'cache-control: max-age=0' -H 'content-length: 6710' -H 'content-type: multipart/form-data; boundary=----WebKitFormBoundaryALBLy00y6zolw7hC' -H 'cookie: .... -H 'origin: https://3joomla.domain' -H 'referer: https://3joomla.domain/administrator/index.php' -H 'sec-ch-ua: "Not?A_Brand";v="8", "Chromium";v="108", "Google Chrome";v="108"' -H 'sec-ch-ua-mobile: ?0' -H 'sec-ch-ua-platform: "Linux"' -H 'sec-fetch-dest: document' -H 'sec-fetch-mode: navigate' -H 'sec-fetch-site: same-origin' -H 'sec-fetch-user: ?1' -H 'upgrade-insecure-requests: 1' -H 'user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36' --compressed 

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.