Publish to a URL group with a 3 second delay and headers/body
You can make a URL group on the QStash console or using the URL group API
Copy
Ask AI
from qstash import QStashclient = QStash("<QSTASH-TOKEN>")res = client.message.publish_json( url_group="my-url-group", body={ "hello": "world", }, headers={ "test-header": "test-value", }, delay="3s",)# When publishing to a URL group, the response is an array of messages for each URL in the groupprint(res[0].message_id)
Callbacks are useful for long running functions. Here, QStash will return the response
of the publish request to the callback URL.We also change the method to GET in this use case so QStash will make a GET request to the url. The default
is POST.