-
-
Save sandeepraju/bfa72c7027e1d739b33e to your computer and use it in GitHub Desktop.
A simple request to enqueue a job into SHARQ Server. Requires Python Requests (http://docs.python-requests.org/en/latest/)
This file contains 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
import json | |
import uuid | |
import requests # install request by running `pip install requests` | |
requests.post('http://localhost:8080/enqueue/sms/1/', | |
data=json.dumps({ | |
# generate unique job_id for each request | |
'job_id': str(uuid.uuid4()), | |
'interval': 1000, # means a rate of 1 job per second | |
'payload': {'message': 'hello, world'} | |
}), | |
headers={'Content-Type': 'application/json'}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment