Kayıtlar

Nisan 15, 2022 tarihine ait yayınlar gösteriliyor

HttpClientFactory üzerinden x-www-form-urlencoded body ile form post etme

Aşağıdaki kod örneğinde olduğu gibi veri post edilir 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 var response = new TokenWrapModel(); var client = _httpClientFactory.CreateClient(); client.BaseAddress = new Uri(_configuration.GetValue< string >( "Authority" )); var data = new [] { new KeyValuePair< string , string >( "client_id" , _configuration.GetValue< string >( "ClientId" )), new KeyValuePair< string , string >( "client_secret" , _configuration.GetValue< string >( "ClientSecret" )), new KeyValuePair< string , string >( "grant_type" , _configuration.GetValue< string >( "GrantType" )), }; var result = await