I am attempting to post some data that includes a string array to an endpoint but receiving an error "Invalid array"
Doing this:
.PostUrlEncodedAsync(new
{
amount = 1000,
allowed_source_types = new[] { "card_present" },
capture_method = "manual",
currency = "usd"
});
Results in this being posted:
amount=1000&allowed_source_types=card_present&capture_method=manual¤cy=usd
The API vendor complains that the array that I posted is invalid. When I do this:
.PostUrlEncodedAsync(
"amount=1000&allowed_source_types[]=card_present&capture_method=manual¤cy=usd"
);
Results in this being posted:
amount=1000&allowed_source_types[]=card_present&capture_method=manual¤cy=usd
The API vendor is happy and I get the expected results.
Question: Is this a bug and should the allowed_source_types parameter have included the [ ] as initially detailed here?