Created
April 26, 2020 15:15
-
-
Save anytizer/997cd5eac4fff6deeef0b7cb547e1b91 to your computer and use it in GitHub Desktop.
RestSharp example
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
RestClient client = new RestClient(configs.login); | |
RestRequest request = new RestRequest("/api/login/", DataFormat.Json); | |
request.AddHeader("Content-Type", "application/json"); | |
request.AddJsonBody(login); | |
IRestResponse response = client.Execute(request, Method.POST); | |
SuccessDTO attempt = JsonConvert.DeserializeObject<SuccessDTO>(response.Content); | |
return attempt.status; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment