Skip to content

Instantly share code, notes, and snippets.

@ebarojas
Last active June 16, 2020 23:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ebarojas/05d5b542f6379d16bd06b2b77a4c6171 to your computer and use it in GitHub Desktop.
Save ebarojas/05d5b542f6379d16bd06b2b77a4c6171 to your computer and use it in GitHub Desktop.
Authorization for Token Auth in C#
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