1. 程式人生 > >第11章 創建請求URLs - IdentityModel 中文文檔(v1.0.0)

第11章 創建請求URLs - IdentityModel 中文文檔(v1.0.0)

tro ast 參數 bar 查詢 結構 tps 示例 endpoint

RequestUrl是創建與查詢字符串參數,例如URL的幫手:

var ru = new RequestUrl("https://server/endpoint");

// produces https://server/endpoint?foo=foo&bar=bar
var url = ru.Create(new
    {
        foo: "foo",
        bar: "bar"
    });

作為Create方法的參數,您可以傳入對象或字符串字典。在這兩種情況下,屬性/值都將序列化為鍵/值對。

註意
所有值都將進行URL編碼。

RequestUrl在創建用於建模特定於域的URL結構的擴展方法時,它非常有用。有關示例,請參閱Authorize Endpoint和EndSession Endpoint。

github地址

第11章 創建請求URLs - IdentityModel 中文文檔(v1.0.0)