本文整理汇总了C#中Request.SetAuthorization方法的典型用法代码示例。如果您正苦于以下问题:C# Request.SetAuthorization方法的具体用法?C# Request.SetAuthorization怎么用?C# Request.SetAuthorization使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Request
的用法示例。
在下文中一共展示了Request.SetAuthorization方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ShouldWriteRequestsCorrectly
public void ShouldWriteRequestsCorrectly()
{
var testRequest = new Request()
{
Method = "system.listMethods",
Parameters = { "Bla" }
};
testRequest.SetAuthorization("wiki", "pedia");
var output = new MemoryStream();
var converter = new MessageConverter();
converter.Convert(new MessageReader(testRequest), new HmBinaryMessageWriter(output));
var outputFormatted = BinaryUtils.FormatMemoryStream(output);
var expected =
"42696E400000002F000000010000000D417574686F72697A6174696F6E0000001642617369632064326C72615470775A57527059513D3D000000250000001273797374656D2E6C6973744D6574686F6473000000010000000300000003426C61";
outputFormatted.ShouldBe(expected);
}