FromBtcAsync错误

时间:2018-05-07 10:21:25

标签: c# blockchain blockchain.info-api

我是BlockChain的新手,我正在为项目使用https://blockchain.info/api c#。

我收到此错误One or more errors occurred. (Additional text encountered after finished reading JSON content: ,. Path '', line 1, position 1.)。当参数btc0.1并降低成功时。

[HttpPost]
public ActionResult ConvertBTCToCurrency(decimal btc, string currency)
{
    var error = "";
    try
    {
        var btcVal = new BitcoinValue(btc);
        explorer = new ExchangeRateExplorer();
        var btcAmountResult = explorer.FromBtcAsync(btcVal, currency).Result;
        return Json(new { statusCode = 200, worthCurrency = btcAmountResult });
    }
    catch (Exception e)
    {
        Debug.WriteLine(e.Message);
        error = e.Message;
    }
    return Json(new { statusCode = 201, worthCurrency = error });
}

0 个答案:

没有答案