MCPcopy Index your code
hub / github.com/ryanmcgrath/twython / get_lastfunction_header

Method get_lastfunction_header

twython/api.py:289–307  ·  view source on GitHub ↗

Returns a specific header from the last API call This will return None if the header is not present :param header: (required) The name of the header you want to get the value of Most useful for the following header information: x-rate-limi

(self, header, default_return_value=None)

Source from the content-addressed store, hash-verified

287 return self.request(endpoint, 'DELETE', params=params, version=version, json_encoded=json_encoded)
288
289 def get_lastfunction_header(self, header, default_return_value=None):
290 """Returns a specific header from the last API call
291 This will return None if the header is not present
292
293 :param header: (required) The name of the header you want to get
294 the value of
295
296 Most useful for the following header information:
297 x-rate-limit-limit,
298 x-rate-limit-remaining,
299 x-rate-limit-class,
300 x-rate-limit-reset
301
302 """
303 if self._last_call is None:
304 raise TwythonError('This function must be called after an API call. \
305 It delivers header information.')
306
307 return self._last_call['headers'].get(header, default_return_value)
308
309 def get_authentication_tokens(self, callback_url=None, force_login=False,
310 screen_name=''):

Calls 2

TwythonErrorClass · 0.85
getMethod · 0.80