Skip to content

Instantly share code, notes, and snippets.

@BoboTiG
Created January 20, 2021 15:20
Show Gist options
  • Save BoboTiG/9865938748bf58b1fc2258b26079c9fb to your computer and use it in GitHub Desktop.
Save BoboTiG/9865938748bf58b1fc2258b26079c9fb to your computer and use it in GitHub Desktop.
Medium - The Mystery of the Endless HTTPS Call
import json
import urllib3
url = "https://<HOST>/nuxeo/api/v1/upload/<BATCH_ID>/0/execute/FileManager.Import"
headers = {
"X-Batch-No-Drop": "true",
"Content-Type": "application/json",
"Cookie": "X-Authentication-Token=<TOKEN>",
}
params = {"context": {"currentDocument":"/default-domain/UserWorkspaces/<USER>"}}
body = json.dumps(params).encode("utf-8")
try:
req = http.request("POST", url, headers=headers, body=body, retries=False, redirect=False)
except KeyboardInterrupt:
print("CTRL+C hit!")
else:
print(json.loads(req.data.decode("utf-8")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment