0

i am Posting a Map data as ArrayList. So i have tried it by Raw body. but i need to post it as Form-Data. I tried it by many ways but i didn't get result. if any one knows the solution, how to do it. please give me solution.

and here is my code belove.

    @Id
    private String id;

    @Field(value = "name")
    private String name;

    @Field(value = "description")
    private String description;

        @Field(value = "attributes")
        private List<Map<String, String>> attributes = new ArrayList<Map<String, String>>();

    this is what i am sending in Body Raw i want to post it by Form-Data

    {
        "name":"Fourth Template",
        "description":"covers most of selected attributes",
        "attributes": [
        {
          "attributeId": "5d4284807748181cbc8a8277",
          "selectedDataSource": "collections"
        },
         {
          "attributeId": "5d4284807748181cbc8a8277",
          "selectedDataSource": "paycom"
        },
         {
          "attributeId": "5d4284807748181cbc8a8277",
          "selectedDataSource": "originations"
        }
      ]
    }
4

2 回答 2

3

Instead of posting it as raw data, in postman you've form-data beside raw data, you can post your formData through it.

See the image link for your reference:

Posting a Map data as ArrayList

于 2019-08-01T11:36:44.210 回答
0

show your controller method, try add @RequestBody Entity or @RequestBody Map map.

于 2019-08-01T08:59:20.143 回答