1007
WebSocket

1007 Invalid Payload Data

An endpoint received a message with payload data that is inconsistent with the message type. For example, a text message contained non-UTF-8 data.

On this page

When You See This Code

A text frame was received but its payload is not valid UTF-8. This commonly happens when binary data is accidentally sent as a text frame.

How to Fix

Ensure text frames contain only valid UTF-8 encoded data. If you need to send raw bytes, use binary frames instead of text frames.

Compare With

Guides

Glossary

Frequently Asked Questions

What is WebSocket 1007 Invalid Payload Data?

An endpoint received a message with payload data that is inconsistent with the message type. For example, a text message contained non-UTF-8 data.

When do you see WebSocket 1007 Invalid Payload Data?

A text frame was received but its payload is not valid UTF-8. This commonly happens when binary data is accidentally sent as a text frame.

How to fix WebSocket 1007 Invalid Payload Data?

Ensure text frames contain only valid UTF-8 encoded data. If you need to send raw bytes, use binary frames instead of text frames.