Skip to content

Commit f958b0c

Browse files
committed
Added the test from #1817
1 parent a1bf71b commit f958b0c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/RestSharp.Tests/RestContentTests.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,17 @@ public void RestContent_CaseInsensitiveHeaders() {
1212

1313
httpContent.Headers.ContentType!.MediaType.Should().Be(myContentType);
1414
}
15+
16+
[Fact]
17+
public void RestContent_supports_manual_json_body() {
18+
const string myContentType = "application/json";
19+
const string myJsonString = "[]";
20+
21+
var request = new RestRequest("resource").AddParameter(myContentType, myJsonString, ParameterType.RequestBody);
22+
var content = new RequestContent(new RestClient(), request);
23+
24+
var httpContent = content.BuildContent();
25+
26+
httpContent.Headers.ContentType!.MediaType.Should().Be(myContentType);
27+
}
1528
}

0 commit comments

Comments
 (0)