Unhandled Exception: None of the transports supported by the client are supported by the server

733 Views Asked by At

I am facing an issue while connecting SignalR from client. I got this error "None of the transports supported by the client are supported by the server.". Also it should GET request instead of log says it's a POST request.

Code:

final httpConnectionOptions = HttpConnectionOptions(
      /*httpClient: WebSupportingHttpClient(logger,
          httpClientCreateCallback: _httpClientCreateCallback),*/
      logger: logger,
      //logMessageContent: true,
      //transport: HttpTransportType.ServerSentEvents,
      //skipNegotiation: true,
    );
    _hubConnection = HubConnectionBuilder()
        .withUrl(
          _serverUrl + formData,
          options: httpConnectionOptions,
          //transportType: HttpTransportType.ServerSentEvents,
        )
        .withAutomaticReconnect()
        //.withAutomaticReconnect(retryDelays: [2000, 5000, 10000, 20000])
        .configureLogging(logger)
        .build();
    _hubConnection.onclose(({error}) => connectionIsOpen = false);

Log:

I/flutter (31934): Starting HubConnection.
I/chatty  (31934): uid=10154 1.ui identical 11 lines
I/flutter (31934): Starting HubConnection.
I/flutter (31934): Starting connection with transfer format 'TransferFormat.Text'.
I/chatty  (31934): uid=10154(com.ci.radico.radico) 1.ui identical 11 lines
I/flutter (31934): Starting connection with transfer format 'TransferFormat.Text'.
I/flutter (31934): Sending negotiation request: <host>/signalr/negotiate?<data>&negotiateVersion=1
I/chatty  (31934): uid=10154() 1.ui identical 11 lines
I/flutter (31934): Sending negotiation request: <host>/signalr/negotiate?<data>&negotiateVersion=1
I/flutter (31934): HTTP send: url '<host>/signalr/negotiate?<data>&negotiateVersion=1', method: 'POST' content: '' content length = '0' headers: '{ content-type: text/plain;charset=UTF-8 }, { X-Requested-With: FlutterHttpClient }'
I/chatty  (31934): uid=10154(com.ci.radico.radico) 1.ui identical 11 lines
I/flutter (31934): HTTP send: url 'https://ps360ordersapi.ci-private-ase.p.azurewebsites.net/signalr/negotiate?<data>&negotiateVersion=1', method: 'POST' content: '' content length = '0' headers: '{ content-type: text/plain;charset=UTF-8 }, { X-Requested-With: FlutterHttpClient }'
I/flutter (31934): Failed to start the connection: None of the transports supported by the client are supported by the server.
I/chatty  (31934): uid=10154() 1.ui identical 11 lines
I/flutter (31934): Failed to start the connection: None of the transports supported by the client are supported by the server.
I/flutter (31934): HubConnection failed to start successfully because of error 'None of the transports supported by the client are supported by the server.'.
I/chatty  (31934): uid=10154() 1.ui identical 11 lines
I/flutter (31934): HubConnection failed to start successfully because of error 'None of the transports supported by the client are supported by the server.'.
E/flutter (31934): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: None of the transports supported by the client are supported by the server.
E/flutter (31934): 
1

There are 1 best solutions below

5
On

Specifically for Azure, web sockets has to be explicitly enabled.