Skip to content

Instantly share code, notes, and snippets.

@sandeepraju
Created September 24, 2014 08:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sandeepraju/bfa72c7027e1d739b33e to your computer and use it in GitHub Desktop.
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/)
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