3.12Setting Raw raw String Content

Created on Aug 17, 2026~1 min read

In modern API testing tools such as Postman, users can send requests in the raw data format. In ASP.NET Core server-side applications, this typically manifests as receiving a string parameter marked with the [FromBody] attribute (for example, str):

cs
[HttpPost]// [Consumes("application/json")]public string AddBodyString([FromBody] string str)  // Note: by default ASP.NET Core does not support binding of the text/plain content type{    return str;}

To set raw string content, use the following methods:

cs
HttpRequestBuilder.Post("https://furion.net/")    .SetRawStringContent("Furion"); // Default content type text/plainHttpRequestBuilder.Post("https://furion.net/")    .SetRawStringContent("Furion", "application/json"); // Content type is requiredHttpRequestBuilder.Post("https://furion.net/")    .SetContent("\"Furion\"", "application/json"); // Equivalent to calling SetRawStringContent