1
Microsoft oData v4 프록시 클라이언트에는 각 요청에 인증 토큰을 추가하는 옵션이 있습니다.간단한 Odata 클라이언트 - 각 요청 헤더에 oAuth 토큰을 추가하는 방법?
var container = new Default.Container(new Uri(http://localhost:9000/));
//Registering the handle to the BuildingRequest event.
container.BuildingRequest += (sender, e) => OnBuildingRequest(sender, e, accessToken);
//Every time a OData request is build it adds an Authorization Header with the acesstoken
private static void OnBuildingRequest(object sender, BuildingRequestEventArgs e, TokenResponse token)
{
e.Headers.Add("Authorization", "Bearer " + token.AccessToken);
}
간단한 odata 클라이언트를 사용하여 어떻게 동일한 작업을 수행 할 수 있습니까?
***에 대한 설명을 추가해보십시오. *** 답변입니다. –