MCPcopy Create free account
hub / github.com/csev/py4e / to_header

Method to_header

code/oauth.py:162–170  ·  view source on GitHub ↗

Serialize as a header for an HTTPAuth request.

(self, realm='')

Source from the content-addressed store, hash-verified

160 return parameters
161
162 def to_header(self, realm=''):
163 """Serialize as a header for an HTTPAuth request."""
164 auth_header = 'OAuth realm="%s"' % realm
165 # Add the oauth parameters.
166 if self.parameters:
167 for k, v in self.parameters.iteritems():
168 if k[:6] == 'oauth_':
169 auth_header += ', %s="%s"' % (k, escape(str(v)))
170 return {'Authorization': auth_header}
171
172 def to_postdata(self):
173 """Serialize as post data for a POST request."""

Callers

nothing calls this directly

Calls 1

escapeFunction · 0.70

Tested by

no test coverage detected