Fix undefined index for REQUEST_METHOD

If we try to catch the input for websocket protocol, $_SERVER['REQUEST_METHOD'] is not set and not needed, so this fix check if this variable is set, if not return ''.