0
我試圖訪問使用「F#數據的Http實用程序」,但沒有成功遠程服務:F# - Http.RequestString錯誤 - 捲曲和PowerShell OK
let account token = Http.RequestString("https://api.example.com/v1",
httpMethod = "POST",
headers = ["Accept", "application/json";
"Content-Type", "application/json";
"X-Application", "JRQ";
"X-Authentication", "MOl5C9ZZ";],
body = TextRequest """ {"jsonrpc": "2.0", "method": "getAccount"} """)
即使兩個捲曲和PowerShell等效正常工作:
curl -i -X POST \
-H "Accept:application/json" \
-H "Content-Type:application/json" \
-H "X-Application:JRQ" \
-H "X-Authentication:MOl5C9ZZ" \
-d '{"jsonrpc": "2.0", "method": "getAccount"}' \
'https://api.example.com/v1'
我缺少什麼?
你有什麼錯誤?它可能與網址缺乏引號有關嗎? –
Fyodor,上面的示例中我的錯誤不包括引號,但這不是F#代碼的問題。我從服務器得到400響應。 – matekus