(self, body, content_type=None)
| 47 | self.url = 'http://' + self.url.strip() |
| 48 | |
| 49 | def send(self, body, content_type=None): |
| 50 | headers = {} |
| 51 | if content_type: |
| 52 | headers['Content-Type'] = content_type |
| 53 | |
| 54 | requests.post(self.url, data=body, headers=headers) |
| 55 | |
| 56 | def __str__(self, *args, **kwargs): |
| 57 | return 'Web-hook at ' + self.url |