retrofit.dart icon indicating copy to clipboard operation
retrofit.dart copied to clipboard

contentType is the string "null"

Open kirill09 opened this issue 1 year ago • 0 comments

Hi.

When using the retrofit_generator, if the Options() is passed to the option parameter. Request header "Content-Type" is set to "null" in the header, an error occurs on line 1204 of the generator.dart file. https://github.com/trevorwang/retrofit.dart/blob/master/generator/lib/src/generator.dart#L1204

This issue was introduced in the MR 057ee3763087ebfbcb61bc5a9483358eab695bd4. To fix this error, it is necessary to use 'contentType: options.contentType?.toString()'.

kirill09 avatar Mar 27 '23 15:03 kirill09