Skip to content

Commit 9885a41

Browse files
committed
Add Version
1 parent 7334e28 commit 9885a41

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/RestSharp/Request/RestRequest.cs

+5
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,11 @@ public RestRequest(Uri resource, Method method = Method.Get)
166166
/// Can be used to skip container or root elements that do not have corresponding deserialization targets.
167167
/// </summary>
168168
public string? RootElement { get; set; }
169+
170+
/// <summary>
171+
/// HTTP version for the request. Default is Version11.
172+
/// </summary>
173+
public Version Version { get; set; } = HttpVersion.Version11;
169174

170175
/// <summary>
171176
/// When supplied, the function will be called before calling the deserializer

src/RestSharp/RestClient.Async.cs

+1
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ async Task<HttpResponse> ExecuteRequestAsync(RestRequest request, CancellationTo
113113
message.Content = requestContent.BuildContent();
114114
message.Headers.Host = Options.BaseHost;
115115
message.Headers.CacheControl = request.CachePolicy ?? Options.CachePolicy;
116+
message.Version = request.Version;
116117

117118
using var timeoutCts = new CancellationTokenSource(request.Timeout ?? Options.Timeout ?? _defaultTimeout);
118119
using var cts = CancellationTokenSource.CreateLinkedTokenSource(timeoutCts.Token, cancellationToken);

0 commit comments

Comments
 (0)