Need help on HUE Upload API to get CSRF Token

Hi,

I need help on getting the csrf token on the upload API (/filebrowser/upload/file?dest=/user/user1)

I can already login, view the HDFS files, etc. but I can’t seem to find where to extract the csrf token particularly for the POST upload. And the csrf token seems to be different for every POST method.

I can see the different csrf tokens for rmtree,rename,set_replication,chmod,move,copy,close,etc
but NOT for upload.

Of course I’ve tried just getting the token on the session cookie but it doesn’t work. I really need to get that token so I can pass it to the X-CSRFToken header. (or maybe csrfmiddlewaretoken?). I’m using python btw. I can also use curl for this.

The use case is to use the HUE API to automate file uploads. (I don’t have access to the server configs)

Also, how do I check the HUE version on the client-side?

Thank you so much in advance.

I’ve solved it by setting the csrfmiddlewaretoken form data and the X-CSRFToken header.
And using /filebrowser/view instead of /hue/filebrowser/view