(self, path, doc)
Sends a POST request to all trusted contacts.

        Request body contains object to post at JSON format.
Sends a POST request to all trusted contacts.
Sends a POST request to all trusted contacts .
def send_creation_to_contacts(self, path, doc):
        '''
        Sends a POST request to all trusted contacts.

        Request body contains object to post at JSON format.
        '''

        tag = None
        if doc.tags:
            tag = doc.tags[0]
        contacts = ContactManager.getTrustedContacts(tag=tag)
        client = ContactClient(self.activity)
        for contact in contacts:
            try:
                client.post(contact, path, doc.toJson(localized=False))
            except HTTPError:
                self.activity.add_error(contact)
                self.activity.save()
def send_creation_to_contacts ( self , path , doc ) : tag = None if doc . tags : tag = doc . tags [ 0 ] contacts = ContactManager . getTrustedContacts ( tag = tag ) client = ContactClient ( self . activity ) for contact in contacts : try : client . post ( contact , path , doc . toJson ( localized = False ) ) except HTTPError : self . activity . add_error ( contact ) self . activity . save ( )