【问题标题】:How can i pass empty array for specific field in postman (form-data)?如何为邮递员(表单数据)中的特定字段传递空数组?
【发布时间】:2020-11-15 16:50:35
【问题描述】:

我正在使用 laravel 框架,需要空数组来执行一些操作,我的请求是 Post with form-data。我不想要它 JsonRequest 我想要带有表单数据请求的空数组。请帮忙。

我正在尝试上面,但它返回null,我想要空数组。

我在后端想要的是[ ] 空数组。

【问题讨论】:

  • Content-Type 是什么?您是否尝试过使用 application/x-www-form-urlencoded ? Key 和 Value 都会为空吗?
  • 这个问题你解决了吗?我尝试使用key: ,但没有成功...

标签: postman


【解决方案1】:

您可以使用空值代替空数组

当你想发送一个数组时,例如你发送 key[index] : value

对于空值,您应该只发送不带括号的键和带有空字符串的值,例如 key : ""key : in postman

【讨论】:

    猜你喜欢
    • 2019-03-20
    • 1970-01-01
    • 2021-12-01
    • 2020-08-26
    • 1970-01-01
    • 2020-06-09
    • 2021-11-11
    • 2017-03-25
    • 1970-01-01
    相关资源
    最近更新 更多