Respond with both body and status code in Nancy

前端 未结 4 1715
花落未央
花落未央 2020-12-29 20:23

I\'m new to Nancy and I want to return both a custom HttpStatusCode and a body (content). If I return an HttpStatusCode, it returns it with a blank body. If I return a str

4条回答
  •  情话喂你
    2020-12-29 21:30

    If you have problems with encoding it's better to use

    return new TextResponse(HttpStatusCode.STATUS, "Text Responsé")
    

提交回复
热议问题