Questions tagged «apiary.io»

6
使用httpClient.GetAsync时添加标题
我正在Windows Store应用程序项目中实现由Apiary.io的其他同事制作的API。 它们显示了我必须实现的方法示例: var baseAddress = new Uri("https://private-a8014-xxxxxx.apiary-mock.com/"); using (var httpClient = new HttpClient{ BaseAddress = baseAddress }) { using (var response = await httpClient.GetAsync("user/list{?organizationId}")) { string responseData = await response.Content.ReadAsStringAsync(); } } 在这种方法和其他方法中,我需要具有一个标头,该标头带有我之前获得的令牌。 这是邮递员(chrome扩展名)的图片,其中包含我正在谈论的标题: 如何将授权标头添加到请求中?
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.