0
我正在嘗試在rails中對REST API執行curl post請求。我試圖做捲曲的要求是:Ruby on Rails用用戶認證curl POST請求
$ curl https://api.intercom.io/events \
-X POST \
-u pi3243fa:da39a3ee5e6b4b0d3255bfef95601890afd80709 \
-H "Content-Type: application/json"
-d' { "event_name" : "invited-friend",
"created_at": 1391691571, "user_id" : "314159" }'
我見過使用net/HTTP在軌API POST請求的例子很多,但我從來沒有發現,增加-u的請求的示例。我該怎麼做呢?
我需要做一個POST請求,我該如何結合這個代碼? –