How to add http headers in suds 0.3.6?

后端 未结 2 667
逝去的感伤
逝去的感伤 2021-01-05 10:56

I have an application in python 2.5 which sends data through suds 0.3.6.

The problem is that the data contains non-ascii characters, so I need the following header t

2条回答
  •  梦毁少年i
    2021-01-05 11:48

    At least in suds 0.4 (maybe earlier?) HTTP headers can also be passed in to the constructor or via the set_options method:

    client = suds.client.Client(url, headers={'key': 'value'})
    client.set_options(headers={'key2': 'value'})
    

提交回复
热议问题