簡體   English   中英

在 httparty 中轉換 curl 請求

[英]convert curl request in httparty

如何在httparty中轉換低於curl的請求

curl --noproxy localhost -k -d '{"username":"admin", "password":"adminpass"}' -H "Content-Type: application/json" https://localhost:8443/api/authentication

讓它工作

require "httparty"

options = 
{
    :http_proxyaddr => nil,
    :headers => {"Content-Type" => "application/json"},
    :verify => false,
    :body => {"username":"admin", "password":"adminpass"}.to_json
}
response = HTTParty.post('https://localhost:8443/api/authentication', options)

puts response.body

暫無
暫無

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

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