wscat icon indicating copy to clipboard operation
wscat copied to clipboard

Not seeing response data

Open paul-uz opened this issue 3 years ago • 2 comments

For example, on my $connect handler, I return

{ statusCode: 200, body: 'Connected' }

But when I connect via wscat, I'm not seeing the body text in the terminal.

paul-uz avatar Aug 02 '22 10:08 paul-uz

What you mean with "$connect handler"? To get that data, the WebSocket server that wscat connects to should send a message like this

websocket.send(JSON.stringify({ statusCode: 200, body: 'Connected' }));

lpinca avatar Dec 17 '22 19:12 lpinca

I wanted to add an issue for not showing the error messages in the body, for example in this case:

error: Unexpected server response: 500
>

when using curl, I get the real error in the body like:

{"message":"Unable to find ....

Maybe I can prepare a PR, if the project is still maintained...

razvanphp avatar Jan 13 '24 09:01 razvanphp