Upload a media and create a tweet with HTTP module

Hello, i’ve been trying for 3 days now to create a HTTP module to upload a media and post a tweet, however i did not find a solution.
I cannot use the X.com module for my specific case, because i need the token (aka the accounts where i post) to be dynamic.
I’ve tryed both with oauth 1.0a and oauth 2.0 token, had no luck unfortunatelly. I’m struggling with the authorization headers i think.
How is it supposed to be done?