I'm building a restful API with NancyFx. Now, I wanted my routes to send back a Reponse with a StatusCode and a ReasonPhrase of my choice depending on what I get from the clients. Here's some code:
Post["/PostSomething"] = _ =>
{
.
.
.
return Negotiate
.WithModel(myDTO)
.WithStatusCode(HttpStatusCode.XX)
.WithReasonPhrase("My reason");
};
The problem I find is that whenever I set an "ReasonPhrase", is ignored if I previously set a StatusCode. In other words, I can only set a StatusCode of my choice without a customized ReasonPhrase, or I can set a ReasonPhrase and send back the "HttpStatusCode.Ok" since I cannot control it anymore.
I found a similar question in this link: How to get a response from the Nancy Negotiator?. But looks never it never got the answer.
If I missed some info, ask me please.
Any thoughts?