def __post_message(self, inbox, data, content_type, **kwargs):
    if (self.allow_localhost or (not self.__is_localhost(inbox))):
        headers = kwargs.pop('headers', dict())
        headers['content-type'] = content_type
        r = requests.post(inbox, data=data, headers=headers, **kwargs)
        r.raise_for_status()
    else:
        raise ValueError('Invalid local inbox.')
def __post_message(self, inbox, data, content_type, **kwargs):
    if (self.allow_localhost or (not self.__is_localhost(inbox))):
        headers = kwargs.pop('headers', dict())
        headers['content-type'] = content_type
        r = requests.post(inbox, data=data, headers=headers, **kwargs)
        r.raise_for_status()
    else:
        raise ValueError('Invalid local inbox.')