Powershell捕获卷曲错误

时间:2020-09-18 07:03:06

标签: javascript windows powershell curl asp.net-web-api

我有一个简单的Powershell函数来调用Web api并获得响应。如何确定网络api调用成功还是失败。如果失败,我如何仅记录失败的异常消息。我在窗户上使用curl。 以下是我的Powershell脚本,

function PowershellCore_CurlFunction()
{
    $curlResponse = curl -s  "$url"
    # How to check if web api call is succeeded or failed
    # How to log error if web api call throws exception
}

1 个答案:

答案 0 :(得分:0)

尝试/抓住,如果/然后应该在您的用例中为您提供帮助

using Xamarin.Forms.PlatformConfiguration;
using Xamarin.Forms.PlatformConfiguration.iOSSpecific;
...

On<iOS>().SetUseSafeArea(true);
相关问题