dio icon indicating copy to clipboard operation
dio copied to clipboard

PUT not working with Http2Adapter

Open cirediew opened this issue 6 years ago • 8 comments

New Issue Checklist

  • [x] I have searched for a similar issue in the project and found none

Issue Info

It looks like PUT is not working with the Http2Adapter. I will get the following error:

HTTP/2 error: Stream error: Stream was terminated by peer (errorCode: 1)

I know of issue #486 in which I referenced dart-lang/http#1361 but as you can see I don't use headers in my example or my real code.

My code:

    var d = Dio()
      ..httpClientAdapter = Http2Adapter(ConnectionManager(idleTimeout: 8000));
    d.putUri(
      Uri.parse("https://jsonplaceholder.typicode.com/posts/1"),
      data: json.encode({"id": 1, "title": 'foo', "body": 'bar', "userId": 1}),
    ).then((response) async {
      LOG.info(response);
}

This example is just a fake API which should also return data, but I get the same error using my own. When I use DefaultHttpClientAdapter there is no problem.

cirediew avatar Feb 10 '20 14:02 cirediew

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still an issue, please make sure it is up to date and if so, add a comment that this is still an issue to keep it open. Thank you for your contributions.

stale[bot] avatar Mar 11 '20 15:03 stale[bot]

Still an issue

cirediew avatar Mar 16 '20 13:03 cirediew

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still an issue, please make sure it is up to date and if so, add a comment that this is still an issue to keep it open. Thank you for your contributions.

stale[bot] avatar Apr 15 '20 13:04 stale[bot]

Still An Issue 🙃

cirediew avatar Apr 16 '20 14:04 cirediew

#760

hongyiweiwu avatar Apr 29 '20 20:04 hongyiweiwu

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still an issue, please make sure it is up to date and if so, add a comment that this is still an issue to keep it open. Thank you for your contributions.

stale[bot] avatar May 30 '20 02:05 stale[bot]

I also face similar error with POST calls when using dio_http2_adapter

ylogx avatar Jun 06 '20 09:06 ylogx

POST method has this issue as well.

kitmoovup avatar Jul 23 '20 06:07 kitmoovup