我有一个简单的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
}
答案 0 :(得分:0)
尝试/抓住,如果/然后应该在您的用例中为您提供帮助
using Xamarin.Forms.PlatformConfiguration;
using Xamarin.Forms.PlatformConfiguration.iOSSpecific;
...
On<iOS>().SetUseSafeArea(true);