1
我使用httplib的發送SOAP請求,但是當我把它我得到以下問題的工作與httplib的:如何使用cookie在python
INFO:root:Response:<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>401 Authorization Required</title>
</head><body>
<h1>Authorization Required</h1>
<p>This server could not verify that you
are authorized to access the document
requested. Either you supplied the wrong
credentials (e.g., bad password), or your
browser doesn't understand how to supply
the credentials required.</p>
</body></html>
我已經設置如下頭:
auth = base64.encodestring('%s:%s' % (username, password)).replace('\n', '')
headers = {"Content-type": "text/xml;charset=utf-8","SOAPAction":"\"\"","Authorization": "Basic %s" % auth}
而不是python,如果我通過SoapUI發送,那麼它似乎是從服務器發送SoapUI的請求時,一些cookie正在發送,然後soapUI重新發送cookie。