Skip to content

FormData.fromMap is encoding request body automatically #1741

@jagadmitul

Description

@jagadmitul

Package

dio

Version

5.0.2

Output of flutter doctor -v

No response

Dart Version

2.19.2

Steps to Reproduce

Future<FormData> mapToFormData(
  Map<String, dynamic> formData,
) async {
  try {
    return FormData.fromMap(formData);
  } catch (e) {
    rethrow;
  }
}

Expected Result

The above code should return request body as:

  • item[0][product_size_id]: 14

Actual Result

Instead of the expected result the code is returning request body as:

  • items%5B0%5D%5Bproduct_size_id%5D: 14

Metadata

Metadata

Assignees

No one assigned

    Labels

    b: regressionWorked before but not nowfixedp: dioTargeting `dio` packages: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions