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
I'm not looking for server side implementation. As i mentioned above, we are using this formatter (as well as Json and Xml from same namespace) to dynamically build HttpClient pipelines using DelegatingHandler and Castle.Core proxies. Its neat way to declare whole serialization\deserialization pipelines using just interface declaration with custom attributes like ContentType, Accept, Route, Method etc. Many 3rd party APIs still uses FormUrlEncoded in POST and GET requests, and we must somehow integrate with them. Removing FormUrlEncodedMediaTypeFormatter from Microsoft.AspNet.WebApi.Client package will force us (and many people who used it similar way) to create our own implementation of FormData formatter, which seems unnecessary, when package already contains this functionality, which can be easily ported to .netstandard.
In fact there is no changes needed to achieve this, besides adding file link to csproj. I`ve event created pull request for this: #76
This only affects .NetStandard project, as for some reason i cant open .Core version of project in VS, its crashing with NullReferenceException. But same change there would be good.
This pull request adds only FormUrlEncodedMediaTypeFormatter back, but there may be other files that simply left abandoned in new projects.
The text was updated successfully, but these errors were encountered:
Chatted with @dougbu and this seems reasonable. We should get the type in both of the client TFMs of this package: the PCL one and the .NET Standard one.
Creating new work to track work @YakhontovYaroslav has done in #76.
Use case
Copied from #4 (comment) with a few edits:
I'm talking about https://github.com/aspnet/AspNetWebStack/blob/master/src/System.Net.Http.Formatting/Formatting/FormUrlEncodedMediaTypeFormatter.cs this class. Its included in https://github.com/aspnet/AspNetWebStack/tree/master/src/System.Net.Http.Formatting , but missing from https://github.com/aspnet/AspNetWebStack/tree/master/src/System.Net.Http.Formatting.NetStandard and Core versions.
I'm not looking for server side implementation. As i mentioned above, we are using this formatter (as well as Json and Xml from same namespace) to dynamically build HttpClient pipelines using
DelegatingHandler
and Castle.Core proxies. Its neat way to declare whole serialization\deserialization pipelines using just interface declaration with custom attributes like ContentType, Accept, Route, Method etc. Many 3rd party APIs still uses FormUrlEncoded in POST and GET requests, and we must somehow integrate with them. RemovingFormUrlEncodedMediaTypeFormatter
from Microsoft.AspNet.WebApi.Client package will force us (and many people who used it similar way) to create our own implementation of FormData formatter, which seems unnecessary, when package already contains this functionality, which can be easily ported to .netstandard.Code Example of such interface:
Later we use helper method to create runtime implementation with necessary
DelegatingHandler
s and Formatters to serialize and deserialize data based on attributes. In the example above, generated proxy will use https://github.com/aspnet/AspNetWebStack/blob/master/src/System.Net.Http.Formatting/Formatting/JsonMediaTypeFormatter.cs for serializing requests andFormUrlEncodedMediaTypeFormatter
for deserializing responses.In fact there is no changes needed to achieve this, besides adding file link to csproj. I`ve event created pull request for this: #76
This only affects .NetStandard project, as for some reason i cant open .Core version of project in VS, its crashing with NullReferenceException. But same change there would be good.
This pull request adds only
FormUrlEncodedMediaTypeFormatter
back, but there may be other files that simply left abandoned in new projects.The text was updated successfully, but these errors were encountered: