我有一个API,我应该将一个特定的id作为参数发送给它,这样它就可以根据过滤后的列表返回数据. 我试着将其发送为:

await this.$store.dispatch("axiosGet",
      {url: 'folder/api/property-walls'}, {propertyEid: this.id}).then(response => {
    if (response.status === 'error') return
    this.wallList = response.data.data.data
  })

but it doesn't make any differences. enter image description here my API recieves sth like this. can anyone help me out with the solution?

推荐答案

您可以在GET请求中使用PARAMS

这会奏效的!

axios.get('/api', {
  params: {
    foo: 'bar'
  }
});

从这个参考文献

Axios get in url works but with second parameter as object it doesn't

Json相关问答推荐

如何在使用GO时检测JSON中不需要的字段?

使用Jolt库对多个数组进行嵌套循环

在MongoDB中检索某个月份和年份的JSON文档

JQ-JSON将键转换为对象

Pandas 对REST API的自定义响应

迭代powershell双维json对象

使用 jq 将非统一的 json 输出转换为汇总表

将来自 Golang 的 JSON API 调用响应输出到 nextjs 前端

如何加入或合并列表元素列表(未知长度)

从 PowerShell 编辑 Windows 终端配置文件设置 JSON

使用 json_query 过滤嵌套列表中的元素

PowerShell - 如何迭代 PSCustomObject 嵌套对象?

Golang / Go - 如果 struct 没有字段,如何将其编组为空?

使用 gson 反序列化对象的特定 JSON 字段

消息通知产生此内容无法显示

在 Java 中比较两个 JSON 文件的最佳方法

如何在 Python 中合并两个 json 字符串?

类型是接口或抽象类,不能实例化

按键值过滤 JSON

play 2 JSON 格式中缺少的属性的默认值