Created
April 4, 2014 02:50
-
-
Save sripathikrishnan/9967172 to your computer and use it in GitHub Desktop.
Airtel Stateless SMS Client
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class AirtelStatelessSMSGateway: | |
| def __init__(self, url, username, password): | |
| self.url = url | |
| self.username = username | |
| self.password = password | |
| def send_sms(self, phone_number, message): | |
| payload = {'mob_no': phone_number, 'text': message, | |
| 'login': self.username, 'pass': self.password} | |
| resp = requests.post(url=url, params=params) | |
| #skipping error handling for brevity |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment