Sergey Zhukov Sergey Zhukov - 1 year ago 164
C# Question

How to set StatusDescription from Kestrel server?

How to set HTTP status descrption from Kestrel Server? I want to return

HTTP/1.1 400 ArgumentException
instead of
HTTP/1.1 400 Bad Request
but can't find
property in
, I can only change
with numeric code.

Here is the sample App:

Answer Source

You need to access the HTTP context features to override the reason phrase, for example:

    .ReasonPhrase = "Stuff here";
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download