Implement SendFormUrlEncoded method for application/x-www-form-urlencoded form data #27
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In #9, the
SendForm
extension method was changed from sending aapplication/x-www-form-urlencoded
request to sending one asmultipart/form-data
instead. This is a breaking change in some cases if sending to an endpoint that doesn't expect form data to come in withmultipart/form-data
encoding (OIDC access token requests for example, see opserver/Opserver#426).This PR re-adds the old behaviour as a new extension method so consuming libraries don't need to add it back themselves.
I expect
application/x-www-form-urlencoded
is the more common media type that consumers will want (when size limitations or file uploads aren't a concern), but I didn't want to revertSendForm
back to its original behaviour to avoid breaking dependent projects again.I could also obsolete
SendForm
and provideSendMultipartForm
/SendFormUrlEncoded
but I don't think it's important enough to inconvenience consumers with changing their code (and getting build errors usingTreatWarningsAsErrors
).