POST multipart/form-data

What's the best way to send POST multipart/form-data, basically replicate this python code in a NR module?

session = requests.session()
response =, verify=False, data={"username": user, "password": pword}, files={"foo": "bar"})

I can set the content of data from a function node with...

msg.payload = { username: user, password: pword};
msg.headers = {'content-type':'multipart/form'};
return msg;

Then send this to a 'http request' node. But I can't find any examples how I'd add the 'files' part...

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.