java - postman 如何将 ArrayList 中的 map 数据作为表单数据发布

标签 java mongodb spring-boot postman postman-native-app

我正在将 map 数据发布为 ArrayList。 所以我用Raw body尝试过。但我需要将其作为表单数据发布。 我尝试了很多方法,但没有得到结果。如果有人知道解决方案,该怎么做。请给我解决方案。

这是我的代码,亲爱的。

    @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"
        }
      ]
    }

最佳答案

在 postman 中,除了原始数据之外,您还可以通过表单数据发布表单数据,而不是将其作为原始数据发布。

查看图片链接以供引用:

Posting a Map data as ArrayList

关于java - postman 如何将 ArrayList 中的 map 数据作为表单数据发布,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57304316/

相关文章:

java - Spring Boot - Mysql 驱动程序 - JPA - 很长一段时间后,服务器运行发布请求显示无法打开 JPA EntityManager 进行事务

java - Maven-Spring-boot-Eclipse 构建成功,但未安装软件包(Lombok)

java - 简单的 Spring @CreatedDate 注释对我不起作用

java - JSON Jackson无限递归错误Java

java - 如何在 mongoDB 文档字段中保留特殊键并删除其中多余的键?

mongodb - DoctrineMongoDBBundle : Specify Read Preference to Document Manager

node.js - Mongoose 输出错误 "Error: connection closed"

Java Word Apache POI - 垂直对齐单元格内容/删除文本后的空格

java - 使用 libgdx 、 sin 和 java 淡入淡出

java - 杰老板。 .ear 部署期间出现 NullPointerException 之一