GET
res = RestClient::Request.execute(
method: :get,
url: ES_SEARCH_URL,
timeout: 30,
headers: {params: params}
)
POST with JSON body
res = RestClient::Request.execute(
method: :post,
url: url,
timeout: 30,
payload: json_body,
headers: {:content_type=>"application/json", :params => params}
)
Post without JSON body
res = RestClient::Request.execute(
method: :post,
url: url,
timeout: 30,
headers: {:content_type=>"application/json", :params => params}
)
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者