c# - ASP.NET Web API multiple post messages single controller or action -
So I have the following issue:
We have a scenario where a third party post message On our server, we have no control over it, and they want to send everything in one URL, so we can not do anything about the query parameters, so my question is, what is the different post It is possible to handle messages with the same action. In essence the contents of the post message will be defined whether the said request should be accompanied.
Post Message 1:
& lt; Xml & gt; & Lt; Content 1 & gt; Content & lt; / Content1 & gt; & Lt; Content2 & gt; Content & lt; / Content2 & gt; & Lt; / XML & gt; Post Message 2:
& lt; Xml & gt; & Lt; Content 1 & gt; Content & lt; / Content1 & gt; & Lt; Content3 & gt; Content & lt; / Content3 & gt; & Lt; / XML & gt; As you can see, some messages will have similar properties.
Thanks
You can use the following signature to accept arbitrary XML content Public, HttpResponseMessage Post ([FromBody] XElement xmlbody) {// Process xmlbody Returns New HTTP Response Modes (HTTPTata Code.); }
I have more information about this kind of raw media type processing.
Comments
Post a Comment