Method WithProblemDetails
- Namespace
- HttpBuildR
- Assembly
- HttpBuildR.ActionResult.dll
WithProblemDetails(HttpResponseMessage, ProblemDetails, JsonSerializerOptions?)
Adds problem details as a json response body
public static HttpResponseMessage WithProblemDetails(this HttpResponseMessage response, ProblemDetails details, JsonSerializerOptions? options = null)
Parameters
responseHttpResponseMessageresponse
detailsProblemDetailsproblem details
optionsJsonSerializerOptionsoptional JsonSerializerOptions
Returns
- HttpResponseMessage
response
WithProblemDetails(HttpResponseMessage, string?, string?, string?, string?, JsonSerializerOptions?)
Adds problem details as a json response body
public static HttpResponseMessage WithProblemDetails(this HttpResponseMessage response, string? type, string? title, string? detail, string? instance, JsonSerializerOptions? options = null)
Parameters
responseHttpResponseMessageresponse
typestringA URI reference [RFC3986] that identifies the problem type
titlestringA short, human-readable summary of the problem type
detailstringA human-readable explanation specific to this occurrence of the problem
instancestringA URI reference that identifies the specific occurrence of the problem
optionsJsonSerializerOptionsoptional JsonSerializerOptions
Returns
- HttpResponseMessage
response