mirror of
https://github.com/django/daphne.git
synced 2025-07-11 08:22:17 +03:00
Added path parameter to the HttpClient.send method (#193)
This commit is contained in:
parent
c4f016b9c2
commit
f8debafbd3
|
@ -56,14 +56,14 @@ class HttpClient(Client):
|
||||||
self._session = session_for_reply_channel(self.reply_channel)
|
self._session = session_for_reply_channel(self.reply_channel)
|
||||||
return self._session
|
return self._session
|
||||||
|
|
||||||
def send(self, to, content={}):
|
def send(self, to, content={}, path='/'):
|
||||||
"""
|
"""
|
||||||
Send a message to a channel.
|
Send a message to a channel.
|
||||||
Adds reply_channel name and channel_session to the message.
|
Adds reply_channel name and channel_session to the message.
|
||||||
"""
|
"""
|
||||||
content = copy.deepcopy(content)
|
content = copy.deepcopy(content)
|
||||||
content.setdefault('reply_channel', self.reply_channel)
|
content.setdefault('reply_channel', self.reply_channel)
|
||||||
content.setdefault('path', '/')
|
content.setdefault('path', path)
|
||||||
content.setdefault('headers', self.headers)
|
content.setdefault('headers', self.headers)
|
||||||
self.channel_layer.send(to, content)
|
self.channel_layer.send(to, content)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user