【问题标题】:Postmates, How to create a list inside a application/x-www-form-urlencoded parameterPostmates,如何在 application/x-www-form-urlencoded 参数中创建列表
【发布时间】:2020-04-02 00:41:10
【问题描述】:

我正在尝试使用此处简要记录的 API:https://postmates.com/developer/docs/#resources__delivery__create-delivery

它使用多部分表单数据(x-www-form-urlencoded)。

他们在这里也有一个教程,有点,用于使用 Postman 进行测试:https://blog.postmates.com/testing-the-postmates-api-with-postman-1d4c55336e85

我遇到的问题是这个“manifest_items”字段。文档简单地将其描述为“正在交付的项目列表”。它有一个无处可去的“属性”链接。但是,在示例响应中, manifest_items 看起来应该包含子元素(名称、数量、大小)。在教程的响应中有第四个(additional_data)。同样在使用 Postman 的教程中,您可以看到 manifest_items 字段中的值,即 [...

这让我觉得它可能是一个数组。无论如何,您如何在数据参数的多部分中定义这样的值?我尝试了多种使用 Postman 和 Talend API 测试器的方法。我没有看到 GUI 方法。一个示例是将“size=small&name=bag&quantity=2”放入字段值中。

不管我做什么,以下是 Postmates 的回应:

{"kind":"error","code":"invalid_params","message":"您请求的参数无效。","params":{}}

这里有什么想法吗?

谢谢,

【问题讨论】:

    标签: postman postmates x-www-form-urlencoded


    【解决方案1】:

    这是他们在 manifest_items 字段中寻找的格式:

    [
        {
            "name": "Jake",
            "quantity": 2,
            "size": "medium"
        }
    ]
    

    【讨论】:

    • 您在键/值输入框中添加了上述内容吗?它并没有真正为我工作。 [{"name": "Jake","quantity": 2,"size": "medium"}]
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-09-11
    • 2020-09-06
    • 2019-05-04
    • 1970-01-01
    • 1970-01-01
    • 2019-12-04
    • 2012-06-30
    相关资源
    最近更新 更多