appspector/flutter-plugin

HTTP Error 411. The request must be chunked or have a content length

sbosell opened this issue · 5 comments

I've confirmed this is an issue with the appspector plugin. If I include the plugin all json requests that have a payload (ie post) throw this error:

HTTP Error 411. The request must be chunked or have a content length.

Removing the plugin and it works correctly.

I am using this library which is just a wrapper on the standard http client.

Hi, thanks for the report! We'll take a look at it.

I compared the headers with the plugin enabled and not and the difference is that the AppSpector plugin is removing:

content-length: 0

Here are the full headers outputted in both cases, hopefully it helps you:

debugPrint(req.headers.toString());

Plugin enabled for a sample POST :

I/flutter (25900): user-agent: Dart/2.12 (dart:io)
I/flutter (25900): content-type: application/json; charset=utf-8
I/flutter (25900): accept: application/json
I/flutter (25900): accept-encoding: gzip
I/flutter (25900): authorization: Bearer redacted
I/flutter (25900): host: redacted
I/flutter (25900):

Plugin disabled

I/flutter (25900): user-agent: Dart/2.12 (dart:io)
I/flutter (25900): accept: application/json
I/flutter (25900): accept-encoding: gzip
I/flutter (25900): content-length: 0
I/flutter (25900): authorization: Bearer redacted
I/flutter (25900): host: redacted
I/flutter (25900):

Hey, @sbosell! Could you try the 0.5.0 version?

Thanks a lot for your report :)