MCPcopy Create free account
hub / github.com/ronreiter/interactive-tutorials / addcredentials

Method addcredentials

suds/transport/http.py:180–185  ·  view source on GitHub ↗
(self, request)

Source from the content-addressed store, hash-verified

178 return HttpTransport.send(self, request)
179
180 def addcredentials(self, request):
181 credentials = self.credentials()
182 if not (None in credentials):
183 encoded = b64encode(':'.join(credentials).encode('utf-8')).decode("ascii")
184 basic = 'Basic %s' % encoded
185 request.headers['Authorization'] = basic
186
187 def credentials(self):
188 return (self.options.username, self.options.password)

Callers 2

openMethod · 0.95
sendMethod · 0.95

Calls 3

credentialsMethod · 0.95
decodeMethod · 0.80
encodeMethod · 0.45

Tested by

no test coverage detected