Set basic auth.
(self, auth)
| 245 | self.chunked = True class="cm"># enable chunked, no need to deal with length |
| 246 | |
| 247 | def update_auth(self, auth): |
| 248 | class="st">""class="st">"Set basic auth."class="st">"" |
| 249 | if auth is None: |
| 250 | auth = self.auth |
| 251 | if auth is None: |
| 252 | return |
| 253 | |
| 254 | if not isinstance(auth, helpers.BasicAuth): |
| 255 | warnings.warn( |
| 256 | &class="cm">#x27;BasicAuth() tuple is required instead ', DeprecationWarning) |
| 257 | auth = helpers.BasicAuth(*auth) |
| 258 | |
| 259 | self.headers[hdrs.AUTHORIZATION] = auth.encode() |
| 260 | |
| 261 | def update_body_from_data(self, data, skip_auto_headers): |
| 262 | if not data: |