universal_html icon indicating copy to clipboard operation
universal_html copied to clipboard

RethrownDartError: Bad state: Attempted to send cookies, but XMLHttpRequest does not support them.

Open vinaykharayat opened this issue 5 months ago • 0 comments

I am getting error RethrownDartError: Bad state: Attempted to send cookies, but XMLHttpRequest does not support them.

Here is my code

    final controller = WindowController();
    await controller.openHttp(
      method: 'GET',
      uri: Uri.parse(URL),
      onRequest: (HttpClientRequest request) {
        request.cookies.add(Cookie('cookie', 'value'));
        request.cookies.add(Cookie('cookie', 'value'));
      },
      onResponse: (HttpClientResponse response) {
        log('Status code: ${response.statusCode}');
      },
    );

vinaykharayat avatar Sep 03 '24 15:09 vinaykharayat