dart-eventsource icon indicating copy to clipboard operation
dart-eventsource copied to clipboard

POST not working

Open meulencv opened this issue 2 years ago • 1 comments

Hello, I'm having problems using the post. I have tried on web

 [...]

 Map body = {
        'text': message.text,
        'apikey': APIKEY,
      };

      EventSource eventSource = await EventSource.connect(
          "myserverurl.com", client: new BrowserClient(),
          body: jsonEncode(body));
      // listen for events
      eventSource.listen((Event event) async {

     [...]

My server is not receiving the post variables Hopefully it can be fixed Thanks :)

meulencv avatar Jun 11 '23 15:06 meulencv

It might be that in the browser environment, HTTP GET requests cannot carry a body.

Aluomolo avatar Apr 25 '24 00:04 Aluomolo