restsharp / restsharp/RestSharp
Make parameters order in a post query configurable
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 9.8k
- Forks
- 2.3k
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
has already mention in this issue #1937
I create this issue to speak about technical solution I will PR.
Is your feature request related to a problem? Please describe.
Some API require an exact order of fields in POST multipart formdata.
I the actual behavior the file is always put in first.
Describe the solution you'd like
Make fields order parametable for each request.
To do that, I plan to add in RestRequest an array of 3 Enum value (like ParameterType.File, ParameterType.Body, ParameterType.Post ) which will define the order. (Maybe the enum already exist ? I don't really search for yet )
The default order will be the actual one [File, body, post] to not break existing code.
In the RequestContent.BuildContent I will use this array to re-order call from line 46 to 53 (maybe will add headers in the list also, not sure yet)
Do you thinks this can be a good solution ? Or do you have better idea ?
Describe alternatives you've considered
No work around found
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading RestRequest and RequestContent.BuildContent, especially the parameter handling around lines 46–53, then review issue #1937 for prior context. Determine how the existing [File, body, post] order is represented and how a per-request order could preserve the current default. Done means the requested order is configurable without breaking existing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- api
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100