Trying to do a REST POST with requests in python. The below code works if I specify a password without any special characters, but as soon as I specify a user which have for example "!" in the password, it will no longer work. (I get a 400 response back from the server.)
import requests
user = 'username'
password = 'Passwd!'
params = {'name': 'user', 'mail': 'address'}
requests.post("https://webserver.com/regName", auth=HttpNtlmAuth('domain\\%s' % (user),'%s' % (password), params=params)
I have tried to encode the password in various ways, but no luck. Anyone have an idea what I can do to solve this?