question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Test message has no 'method' or 'client' keys

See original GitHub issue

Hi.

When I submit message to channel via HttpClient, like so client.send_and_consume('websocket.connect', {'value': 'my_value'}, path=url)

in consumer I get message (channels.message.Message object) without ‘method’ or ‘client’ keys (and therefore can’t transform it with AsgiRequest(msg) and such).

Could you clarify if it is a bug?

ps channels==1.1.2 asgi_redis==1.2.1

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:13 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
Krukovcommented, Apr 16, 2017

@gyermolenko You need to add ‘query_string’ to a message, you can do this with content kwarg

client.send_and_consume('websocket.connect', content={'query_string': 'token=mytoken'}, path=url)

Also you need to fake method like in example that you give.

@proofit404 Yes you right, then I support the idea of separation clients for http and websocket.

0reactions
gyermolenkocommented, Apr 24, 2017

@Krukov thanks

content={‘query_string’: ‘token=mytoken’}

helped a lot

Read more comments on GitHub >

github_iconTop Results From Across the Web

'str' object has no attribute 'decode'. Python 3 error?
You are trying to decode an object that is already decoded. You have a str , there is no need to decode from...
Read more >
A similar object exists in test mode, but a live mode key was ...
It sounds like your while your client is using your test publishable key, your server is not using your test secret key, but...
Read more >
Error Messages | Maps JavaScript API - Google Developers
The current URL loading the Maps JavaScript API has not been added to the list of allowed referrers. Please check the referrer settings...
Read more >
API keys | Stripe Documentation
Stripe authenticates your API requests using your account's API keys. Stripe raises an invalid request error if you don't include a key, ...
Read more >
Error codes and messages - Adyen Docs
The payment method is not set up with installment. Solution: Check the requestData . Configure installment under the specific payment method; for example,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found