Last active
June 16, 2020 23:12
-
-
Save ebarojas/05d5b542f6379d16bd06b2b77a4c6171 to your computer and use it in GitHub Desktop.
Authorization for Token Auth in C#
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
using System; | |
using RestSharp; | |
public class Program | |
{ | |
public static void Main() | |
{ | |
var client = new RestClient("https://integration.prescrypto.com/api/v2/medics/"); | |
client.Timeout = -1; | |
var request = new RestRequest(Method.GET); | |
request.AddHeader("Authorization", "Token the_token"); | |
request.AddHeader("Accept", "application/json"); | |
IRestResponse response = client.Execute(request); | |
Console.WriteLine(response.Content); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment