You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Similar to #15, but for function calls like FlurlClient.PostUrlEncodedAsync.
Basically I have a form that takes in multiple values for a single key; the resulting encoded form data is something like key[]=value1&key[]=value2&key[]=value3. This would work if I were doing a GET with query string, but as I need to POST the data I have to use a workaround like such:
var kvp = new List<KeyValuePair<string, string>>();
foreach (var v in values)
{
kvp.Add(new KeyValuePair<string, string>("key[]", v.ToString()));
}
var webpage = await url
.WithClient(_client)
.PostAsync(new FormUrlEncodedContent(kvp))
.ReceiveString();
This works just fine, but when I use HttpTest I'm not able to assert what the request body should be because it throws the following exception:
Flurl.Http.FlurlHttpException: RequestBody is only available when Request.Content derives from Flurl.Http.Content.CapturedStringContent
Ideally when POSTing a urlencoded form, we can take the same approach as in #15 and enumerate if a value is of IEnumerable type.
The text was updated successfully, but these errors were encountered:
I think this is a good enhancement, but unfortunately I'm clearing the deck for work on Flurl.Http 2.0. No dates set but this might sit for a while. In the mean time you can certainly use this in your own projects by registering a custom serializer. I will get this merged into the core eventually. Thanks!
Similar to #15, but for function calls like
FlurlClient.PostUrlEncodedAsync
.Basically I have a form that takes in multiple values for a single key; the resulting encoded form data is something like
key[]=value1&key[]=value2&key[]=value3
. This would work if I were doing a GET with query string, but as I need to POST the data I have to use a workaround like such:This works just fine, but when I use
HttpTest
I'm not able to assert what the request body should be because it throws the following exception:Flurl.Http.FlurlHttpException: RequestBody is only available when Request.Content derives from Flurl.Http.Content.CapturedStringContent
Ideally when POSTing a urlencoded form, we can take the same approach as in #15 and enumerate if a value is of
IEnumerable
type.The text was updated successfully, but these errors were encountered: