Closed skywalkeryin closed 3 years ago
Hello,
What's the path of your APIs?
Closed as there's no response.
Hi, I had the same problem... I was returning a string
with html
and it seems autowrapper changed the status 200
to 404
....
The solution was to add BypassHTMLValidation
This really threw me off for several hours as I tried to debug why one endpoint stopped working with a 404 (not found) despite returning all the data in the exception message.
Maybe this should be changed to a 500 or something with a real error message, rather than the original response body.
Hi, I had the same problem... I was returning a
string
withhtml
and it seems autowrapper changed the status200
to404
....The solution was to add
BypassHTMLValidation
I also send html code string and get 404 ,and the wanted data in the exceptionMessage
{
"isError": true,
"responseException": {
"exceptionMessage": {
"commentList": [
{
"id": 19,
"createdUser": "4k2n1gmr4zt5w03t0xg075p4wn"
}
],
"pagerHtml": "\r\n<ul class=\"pager\"><li class=\"disabled first\"><a><<</a></li><li class=\"disabled\"><a rel=\"prev\"><</a></li><li class=\"active\"><a href=\"/api/common/comment/Index?AuditStatus=030203&Status=1&page=1\">1</a></li><li><a href=\"/api/common/comment/Index?AuditStatus=030203&Status=1&page=2\" rel=\"next\">2</a></li><li><a href=\"/api/common/comment/Index?AuditStatus=030203&Status=1&page=2\" rel=\"next\">></a></li><li class=\"last\"><a href=\"/api/common/comment/Index?AuditStatus=030203&Status=1&page=2\">>></a></li></ul>\r\n"
}
}
}
Hi author, I request a get api, the data can get from database, but it will return 404 after autoWrapper. If I add [AutoWrapIgnore] to get method, then no 404 anymore, reponse is 200.
[HasPermission(Permissions.GET_QUOTATION)] [HttpGet] //[AutoWrapIgnore] public async Task<ApiResponse> Get([FromQuery] string guid) { Quotation quotation = await _quotationService.GetQuotationWithItems(guid); var quotationResponseDTO = _mapper.Map<Quotation, QuotationResponseDTO>(quotation); // over here quotationResponseDTO had value return new Success(quotationResponseDTO); }