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
in the starup file I added this: services.AddControllers(...).AddXmlSerializerFormatters()
It works well as long as incoming request has utf-8 encoding i.e. new StringContent(xmlText, Encoding.UTF8, "application/xml");
But I want to send request using Encoding.GetEncoding("iso-8859-1").
The header in XML document is changed accordingly.
When I use iso-8859-1 - the call fails, before the controller action with response 415 - Unsupported Media Type.
What can I do to make the controller action accept iso-8859-1 ?
Thank you.
area-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templates
1 participant
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi All,
I am using net6 webApi project. Controller action is supposed to consume/produce XML and has these attributes:
in the starup file I added this:
services.AddControllers(...).AddXmlSerializerFormatters()
It works well as long as incoming request has utf-8 encoding i.e.
new StringContent(xmlText, Encoding.UTF8, "application/xml");
But I want to send request using
Encoding.GetEncoding("iso-8859-1")
.The header in XML document is changed accordingly.
When I use iso-8859-1 - the call fails, before the controller action with response 415 - Unsupported Media Type.
What can I do to make the controller action accept iso-8859-1 ?
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions