簡體   English   中英

將Typheus中的數組作為url參數傳遞

[英]Pass an array in Typheus as url param

我正在使用Typhoeus,希望在url參數中發送一個數組。

通過此:

/event?groups[]=open-forum&groups[]=armory-films

代替這個:

/event?groups[0]=open-forum&groups[1]=armory-films

借助ethon內部參數,可以查找到看起來可能存在的問題:

 params_encoding and takes :rack

但是當我添加參數時如何將其添加到typehus請求中

Typhoeus::Request.new(endpoint,
                      method: :put,
                      headers: HEADERS,
                      params_encoding: :rack,
                      params: {
                        status: 'close',
                        shutdown_on: I18n.l(closed_at, format: :es),
                        affected_external_id: reference,
                        fqdns:fqdns
                      })

我得到:

The option: params_encoding is invalid.

問題是使用了過時的thyphoeus寶石,該寶石在實際發行時有效 ,並且大於1.0.0

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM