3
Rubyコードで複製された次のcurlコマンド(動作します)を取得しようとしていますが、 'Customer-Id'ヘッダー部分がAPIによって送信/取得されないようです。HTTPartyヘッダーがrubyスクリプトで動作しない
curlコマンドは次のようになります。その顧客の情報を返します curl -u ‘[email protected]’ -H ‘Customer-Id: 243’ https://192.168.50.50/api/customers
。しかし、Rubyでは、以下のコードは動作しません。
auth = {
username: “[email protected]”,
password: "#{pass}"
}
@result = HTTParty.get("https://192.168.50.50/api/customers",:basic_auth => auth, :headers => { ‘Customer-Id: 243’ }).parsed_response
puts @result
私がここで間違っていることを誰かが知っていれば、それは分かります!