Skip to content

Commit bfe0236

Browse files
committed
Disable GET/HEAD with body on .NET 4.8 because it's not reliable
1 parent 08c1578 commit bfe0236

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

test/RestSharp.Tests.Integrated/RequestBodyTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ public sealed class RequestBodyTests : IDisposable {
1212
readonly WireMockServer _server = WireMockServer.Start(s => s.AllowBodyForAllHttpMethods = true);
1313

1414
async Task AssertBody(Method method, bool disableCharset = false) {
15+
#if NET
1516
var options = new RestClientOptions(_server.Url!) { DisableCharset = disableCharset };
1617
using var client = new RestClient(options);
1718
var request = new RestRequest(RequestBodyCapturer.Resource, method);
@@ -25,6 +26,7 @@ async Task AssertBody(Method method, bool disableCharset = false) {
2526

2627
var expected = disableCharset ? ExpectedTextContentTypeNoCharset : ExpectedTextContentType;
2728
AssertHasRequestBody(capturer, expected, bodyData);
29+
#endif
2830
}
2931

3032
[Fact]

test/RestSharp.Tests.Integrated/RequestTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public async Task Can_Perform_GET_Async() {
5050
response.Content.Should().Be(val);
5151
}
5252

53+
#if NET
5354
[Fact]
5455
public async Task Can_Timeout_GET_Async() {
5556
var request = new RestRequest("timeout").AddBody("Body_Content");
@@ -61,6 +62,7 @@ public async Task Can_Timeout_GET_Async() {
6162

6263
response.ResponseStatus.Should().Be(ResponseStatus.TimedOut, response.ErrorMessage);
6364
}
65+
#endif
6466

6567
[Fact]
6668
public async Task Can_Perform_Delete_With_Response_Type() {

0 commit comments

Comments
 (0)