Ejemplo n.º 1
0
        public static WSAPIClient ForToken(WSSettings settings)
        {
            var client = new WSAPIClient();

            client.BaseAddress = new Uri(settings.root);
            client.DefaultRequestHeaders.Accept.Clear();
            client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
            return(client);
        }
Ejemplo n.º 2
0
        public static WSAPIClient ForMIMEType(WSSettings settings, string mimetype)
        {
            var client = new WSAPIClient();

            client.BaseAddress = new Uri(settings.root);
            client.DefaultRequestHeaders.Accept.Clear();
            client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue(mimetype));
            client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", settings.sessionToken);
            return(client);
        }
Ejemplo n.º 3
0
 public static WSAPIClient ForPDF(WSSettings settings)
 {
     return(WSAPIClient.ForMIMEType(settings, "application/pdf"));
 }