是否可以使用Postman Chrome扩展发送数组? [英] Is it possible to send an array with the Postman Chrome extension?

查看:204
本文介绍了是否可以使用Postman Chrome扩展发送数组?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用Postman Chrome扩展程序来测试我的API,并希望通过发布发送ID数组。有没有办法将邮件列表作为邮递员的参数?

  {
user_ids:[1234 ,5678]
}


解决方案

您需要用 [] 后缀变量名称,如下所示:



如果这不起作用,请不要将索引放在括号中:

  my_array [] value1 
my_array [] value2






注意:

  • 如果您使用你可以通过选择 raw / json (而不是表单数据)。另外,请务必在 Headers 中将 Content-Type 设置为 application / json c $ c>标签。
    这里是原始数据 {user_ids:[123233]} 的示例,不要忘记引号!

  • 如果您使用 postman REST客户端您必须使用上述方法,因为将数据作为原始数据(json)传递将不起作用。邮差REST客户端中存在一个错误(当我使用 0.8.4.6 时,至少发现了错误)。



    I've been using Postman Chrome extension to test out my API and would like to send an array of IDs via post. Is there a way to send something list this as a parameter in Postman?

    {
      user_ids: ["1234", "5678"]
    }
    

    解决方案

    You need to suffix your variable name with [] like this:

    If that doesn't work, try not putting indexes in brackets:

    my_array[]  value1
    my_array[]  value2
    


    Note:

    • If you are using the postman packaged app, you can send an array by selecting raw / json (instead of form-data). Also, make sure to set Content-Type as application/json in Headers tab. Here is example for raw data {"user_ids": ["123" "233"]}, don't forget the quotes!

    • If you are using the postman REST client you have to use the method I described above because passing data as raw (json) won't work. There is a bug in the postman REST client (At least I get the bug when I use 0.8.4.6).

    这篇关于是否可以使用Postman Chrome扩展发送数组?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆