我有Httpclient函数,我试图转换为RestSharp但我面临一个问题,我无法解决使用谷歌.
client.BaseAddress = new Uri("http://place.holder.nl/");
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer",access_token);
HttpResponseMessage response = await client.GetAsync("api/personeel/myID");
string resultJson = response.Content.ReadAsStringAsync().Result;
Run Code Online (Sandbox Code Playgroud)
这个代码在我的HttpClient代码中,它运行良好,但是我无法在RestSharp中使用它,我在使用RestSharp时总是未经授权:
RestClient client = new RestClient("http://place.holder.nl");
RestRequest request = new RestRequest();
client.Authenticator = new HttpBasicAuthenticator("Bearer", access_token);
request.AddHeader("Accept", "application/json");
request.Resource = "api/personeel/myID";
request.RequestFormat = DataFormat.Json;
var response = client.Execute(request);
Run Code Online (Sandbox Code Playgroud)
我错过了认证的东西吗?
我试图在我购买的物理 iPhone 4s 上调试我的应用程序。iphone 完全是空的,我做了启动配置,仅此而已。我的 VS2015 连接到我的 Mac 构建主机,其中也连接了 iPhone 4s。据我所知,证书已安装且正确。iPhone 在 VS2015 中作为调试设备出现
运行 10.10.5 (Yosemite) 和 Xcode 和 Xamarin Studio 的 Macbook Pro。Windows 8.1 安装在该 Mac 上的 VM 上,带有 VS2015 和整个 Xamarin 包。
完整的错误是:
error MT1006:
Could not install the application '/Users/*placeholder*/Library/Caches/Xamarin/mtbs/builds/*placeholder*/*placeholder*/bin/iPhone/Debug/*placeholder*.app' on the device iPhone van *placeholder*: Container Creation Failed Error (error: 0xe8000041).
Run Code Online (Sandbox Code Playgroud)
我用占位符替换了一些个人详细信息
在 Mac 上使用 Xamarin Studio 构建时,使用 VS2015 构建时也会出现此错误
我找不到有关如何解决此问题的信息,所以我希望人们可以帮助我。
马丁