Kubernetes pod exec API - Upgrade request required
I think you are trying to exec into a pod. A websocket connection is required if you want to exec into a pod.
For a websocket connection, an http(s) call is made first, followed by an upgrade request to websocket using the HTTP Upgrade header.
curl does not support upgrade from http to websocket. Hence the error.
kubectl exec would be handy for this use case.
You can also try other cli tools which support websockets, like
wscat
wssh