-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[chore] Replace HTTP method, prep for RestSharp drop (#436)
- Loading branch information
Showing
22 changed files
with
147 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
using System.Net.Http; | ||
|
||
namespace EasyPost.Http | ||
{ | ||
/// <summary> | ||
/// Enum representing the available HTTP methods. | ||
/// </summary> | ||
public class Method | ||
{ | ||
internal HttpMethod HttpMethod { get; } | ||
|
||
internal RestSharp.Method RestSharpMethod { get; } | ||
|
||
/// <summary> | ||
/// HTTP GET method. | ||
/// </summary> | ||
public static readonly Method Get = new Method(HttpMethod.Get, RestSharp.Method.Get); | ||
/// <summary> | ||
/// HTTP POST method. | ||
/// </summary> | ||
public static readonly Method Post = new Method(HttpMethod.Post, RestSharp.Method.Post); | ||
/// <summary> | ||
/// HTTP PUT method. | ||
/// </summary> | ||
public static readonly Method Put = new Method(HttpMethod.Put, RestSharp.Method.Put); | ||
/// <summary> | ||
/// HTTP DELETE method. | ||
/// </summary> | ||
public static readonly Method Delete = new Method(HttpMethod.Delete, RestSharp.Method.Delete); | ||
/// <summary> | ||
/// HTTP PATCH method. | ||
/// </summary> | ||
public static readonly Method Patch = new Method(new HttpMethod("PATCH"), RestSharp.Method.Patch); | ||
|
||
private Method(HttpMethod httpMethod, RestSharp.Method restSharpMethod) | ||
{ | ||
HttpMethod = httpMethod; | ||
RestSharpMethod = restSharpMethod; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.