【问题标题】:Pass multiple query parameter values with clj-http使用 clj-http 传递多个查询参数值
【发布时间】:2016-07-14 14:31:00
【问题描述】:

我需要向外部服务 (Twilio) 发出 Web 请求,并为同一参数指定多个值,例如

GET /some-url?status=1&status=2&status=3

我如何告诉 clj-http 像这样对请求进行编码?

【问题讨论】:

    标签: clojure twilio clj-http


    【解决方案1】:

    您可以在sequential 内为您的:query-param 值放置多个值:

    (client/get
      "http://yoursite.com/some-url"
      {:query-params {"status" [1 2 3]}
       :debug true})
    

    【讨论】:

    • 我认为它适用于任何 HTTP 方法 - 您可以轻松检查它。
    猜你喜欢
    • 2015-04-29
    • 1970-01-01
    • 2018-03-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-06-23
    相关资源
    最近更新 更多