Browse Source
Support `IEnumerable` in `GenerateFormPostDataAsync` method.
Resolve #10540
pull/10547/head
maliming
5 years ago
No known key found for this signature in database
GPG Key ID: 96224957E51C89E
1 changed files with
8 additions and
0 deletions
-
framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/ClientProxying/ClientProxyRequestPayloadBuilder.cs
|
|
|
@ -1,4 +1,5 @@ |
|
|
|
using System; |
|
|
|
using System.Collections; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Linq; |
|
|
|
using System.Net.Http; |
|
|
|
@ -151,6 +152,13 @@ namespace Volo.Abp.Http.Client.ClientProxying |
|
|
|
formData.Add(streamContent, parameter.Name, content.FileName ?? parameter.Name); |
|
|
|
} |
|
|
|
} |
|
|
|
else if (value.GetType().IsArray || (value.GetType().IsGenericType && value is IEnumerable)) |
|
|
|
{ |
|
|
|
foreach (var item in (IEnumerable) value) |
|
|
|
{ |
|
|
|
formData.Add(new StringContent(item.ToString(), Encoding.UTF8), parameter.Name); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
formData.Add(new StringContent(value.ToString(), Encoding.UTF8), parameter.Name); |
|
|
|
|