Skip to content

Commit

Permalink
Removed obsolete request method with jtoken param
Browse files Browse the repository at this point in the history
  • Loading branch information
sacOO7 committed Sep 15, 2023
1 parent 1fb6e57 commit f685fd9
Showing 1 changed file with 7 additions and 18 deletions.
25 changes: 7 additions & 18 deletions src/IO.Ably.Shared/AblyRest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -308,23 +308,6 @@ internal async Task<HttpPaginatedResponse> HttpPaginatedRequestInternal(Paginate
return await ExecuteHttpPaginatedRequest(request, requestParams, HttpPaginatedRequestInternal);
}

/// <summary>
/// Make a generic HTTP request against an endpoint representing a collection
/// of some type; this is to provide a forward compatibility path for new APIs.
/// </summary>
/// <param name="method">http method.</param>
/// <param name="path">the path component of the resource URI.</param>
/// <param name="requestParams">(optional; may be null): any parameters to send with the request; see API-specific documentation.</param>
/// <param name="body">(optional; may be null): an instance of RequestBody. It will be sent as a json object.</param>
/// <param name="headers">(optional; may be null): any additional headers to send; see API-specific documentation.</param>
/// <returns>a page of results.</returns>
[Obsolete("Use Request method with json string request body instead")]
public async Task<HttpPaginatedResponse> Request(string method, string path, Dictionary<string, string> requestParams = null, JToken body = null, Dictionary<string, string> headers = null)
{
var httpMethod = new HttpMethod(method);
return await Request(httpMethod, path, requestParams, body, headers);
}

/// <summary>
/// Make a generic HTTP request against an endpoint representing a collection
/// of some type; this is to provide a forward compatibility path for new APIs.
Expand All @@ -338,7 +321,13 @@ public async Task<HttpPaginatedResponse> Request(string method, string path, Dic
public async Task<HttpPaginatedResponse> Request(string method, string path, Dictionary<string, string> requestParams = null, string body = null, Dictionary<string, string> headers = null)
{
var httpMethod = new HttpMethod(method);
return await Request(httpMethod, path, requestParams, JToken.Parse(body), headers);
JToken requestBody = null;
if (body != null)
{
requestBody = JToken.Parse(body);
}

return await Request(httpMethod, path, requestParams, requestBody, headers);
}

/// <summary>
Expand Down

0 comments on commit f685fd9

Please sign in to comment.