I have a http connector in a process flow which communicates with a .net core 3.0 web api. The API can both produce XML and JSON:
>HttpPost]
>Produces("application/xml", new stringg] { "application/json" })]
public IActionResult Post()
If I do a call with no accept headers specified, this API returns the content as application/json. According to the documentation you can add headers to the HTTP connector:
> { "Key": "Accept", "Value": "application/json" } ]
or:
> { "Key": "Accept", "Value": "application/xml" } ]
To specify the expected result content type, so if XML is required, the last header should be applied.
When I add this and execute the http connector it shows me the following message:
The 'Accept' header must be modified using the appropriate property or method.
Parameter name: name
With a stack trace:
The 'Accept' header must be modified using the appropriate property or method.
Parameter name: nameat System.Net.WebHeaderCollection.ThrowOnRestrictedHeader(String headerName)
at System.Net.WebHeaderCollection.Add(String name, String value)
at Thinkwise.Shared.ObjectModel.ProcessAction.NoContext.HttpConnector.PerformInternal(ActiveProcessFlow activeFlow, Pending pendingProcessAction, TSFController targetController)
at Thinkwise.Shared.ObjectModel.ProcessAction.Perform(ActiveProcessFlow activeFlow, Pending pendingProcessAction, TSFController sourceController)
at Thinkwise.Shared.ActiveProcessFlow.executeActiveProcessAction(IProcessActionStartParameters startParameters)
I have no clue what I'm doing wrong, and it looks very familiar to these topics:
https://community.thinkwisesoftware.com/development-13/http-connector-output-issue-i-think-290 (last post)
and
How can i make sure the accepted content type is as specified?