Skip to content

Commit 02f478b

Browse files
committed
Removed a bit more Obsolete things as they aren't Obsolete as such, the next major will have to be incompatible anyway
2 parents a5ad266 + 4450303 commit 02f478b

File tree

8 files changed

+2
-17
lines changed

8 files changed

+2
-17
lines changed

src/RestSharp/Http.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -223,12 +223,9 @@ static void AddRange(HttpWebRequest r, string range) {
223223
public bool ThrowOnAnyError { get; set; }
224224

225225
[Obsolete]
226-
public static IHttp Create()
227-
=> new Http();
226+
public static IHttp Create() => new Http();
228227

229-
[Obsolete("Overriding this method won't be possible in future version")]
230-
protected virtual HttpWebRequest? CreateWebRequest(Uri url)
231-
=> null;
228+
protected virtual HttpWebRequest? CreateWebRequest(Uri url) => null;
232229

233230
static HttpWebRequest CreateRequest(Uri uri)
234231
=> (HttpWebRequest)WebRequest.Create(uri);

src/RestSharp/HttpCookie.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ namespace RestSharp
1919
/// <summary>
2020
/// Representation of an HTTP cookie
2121
/// </summary>
22-
[Obsolete("The HttpCookie class will be removed in future versions")]
2322
public class HttpCookie
2423
{
2524
/// <summary>

src/RestSharp/HttpHeader.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ public HttpHeader(string name, object? value) : this(name, value?.ToString()) {
4444
/// <summary>
4545
/// Creates a new instance of HttpHeader. Remember to assign properties!
4646
/// </summary>
47-
[Obsolete("Use parameterized constructor")]
4847
public HttpHeader() { }
4948

5049
/// <summary>

src/RestSharp/HttpParameter.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ public HttpParameter(string name, string? value, string? contentType = null)
4444
/// <param name="contentType">Parameter content type</param>
4545
public HttpParameter(string name, object? value, string? contentType = null) : this(name, value?.ToString(), contentType) { }
4646

47-
[Obsolete("Use parameterized constructor")]
4847
public HttpParameter() { }
4948

5049
/// <summary>

src/RestSharp/IRestRequest.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ public interface IRestRequest
207207
/// <param name="obj">The object to serialize</param>
208208
/// <param name="xmlNamespace">The XML namespace to use when serializing</param>
209209
/// <returns>This request</returns>
210-
[Obsolete("Use AddJsonBody or AddXmlBody instead")]
211210
IRestRequest AddBody(object obj, string xmlNamespace);
212211

213212
/// <summary>
@@ -216,7 +215,6 @@ public interface IRestRequest
216215
/// </summary>
217216
/// <param name="obj">The object to serialize</param>
218217
/// <returns>This request</returns>
219-
[Obsolete("Use AddJsonBody or AddXmlBody instead")]
220218
IRestRequest AddBody(object obj);
221219

222220
/// <summary>

src/RestSharp/RequestBody.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ public class RequestBody {
2020
public string Name { get; }
2121
public object Value { get; }
2222

23-
[Obsolete("The RestBody constructor will be internal in future versions")]
2423
public RequestBody(string contentType, string name, object value) {
2524
ContentType = contentType;
2625
Name = name;

src/RestSharp/RestRequest.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,6 @@ public IRestRequest AddFileBytes(
235235
}
236236

237237
/// <inheritdoc />
238-
[Obsolete("Use AddXmlBody")]
239238
public IRestRequest AddBody(object obj, string xmlNamespace)
240239
=> RequestFormat switch
241240
{
@@ -245,7 +244,6 @@ public IRestRequest AddBody(object obj, string xmlNamespace)
245244
};
246245

247246
/// <inheritdoc />
248-
[Obsolete("Use AddXmlBody or AddJsonBody")]
249247
public IRestRequest AddBody(object obj)
250248
=> RequestFormat switch
251249
{
@@ -467,7 +465,6 @@ public IRestRequest AddDecompressionMethod(DecompressionMethods decompressionMet
467465
public DataFormat RequestFormat { get; set; }
468466

469467
/// <inheritdoc />
470-
[Obsolete("Add custom content handler instead. This property will be removed.")]
471468
public string RootElement { get; set; }
472469

473470
/// <inheritdoc />
@@ -477,11 +474,9 @@ public IRestRequest AddDecompressionMethod(DecompressionMethods decompressionMet
477474
public Action<IHttp>? OnBeforeRequest { get; set; }
478475

479476
/// <inheritdoc />
480-
[Obsolete("Add custom content handler instead. This property will be removed.")]
481477
public string DateFormat { get; set; }
482478

483479
/// <inheritdoc />
484-
[Obsolete("Add custom content handler instead. This property will be removed.")]
485480
public string XmlNamespace { get; set; }
486481

487482
/// <inheritdoc />

src/RestSharp/RestResponseCookie.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
namespace RestSharp
1818
{
19-
[Obsolete("We will use HttpCookie in the response as well in the next major version")]
2019
public class RestResponseCookie
2120
{
2221
/// <summary>

0 commit comments

Comments
 (0)