在Code中,我试图在同一个请求中发送标头和cookie 下面是代码
@result = RestClient.post(
'url',
{:billingSourceCode => "code"},
{:cookies => {:session_id => "1234"}},
{:headers => {'Content-Type' =>'application/json',
"Authorization" => "key",
"Accept" => "application/json"}})
我收到以下错误消息
ArgumentError (wrong number of arguments (4 for 3)):
答案 0 :(得分:1)
Cookie是标题的一部分。这里是RestClient
:
@cookies = @headers.delete(:cookies) || args[:cookies] || {}
请参阅https://github.com/rest-client/rest-client/blob/master/lib/restclient/request.rb
中的initialize
方法
这样做 -
@result = RestClient.post(
'url',
{:billingSourceCode => "code"},
{:headers => {'Content-Type' =>'application/json',
"Authorization" => "key",
"Accept" => "application/json"},
{:cookies => {:session_id => "1234"}}
})
答案 1 :(得分:0)
尝试
=SUMIFS(B:B,A:A,"="&A2,C:C,"="&C2,D:D,"="&D2)