Ejemplo n.º 1
0
        public async Task <PublicTokenExchangeResponse> PublicTokenExchangeAsync(PublicTokenExchangeRequest request)
        {
            var data    = JsonSerializer.Serialize(request, SerializerOptions);
            var content = new StringContent(data, Encoding.UTF8, "application/json");

            var httpResponse = await HttpClient.PostAsync("/item/public_token/exchange", content);

            httpResponse.EnsureSuccessStatusCode();

            var rawResponse = await httpResponse.Content.ReadAsStringAsync();

            return(JsonSerializer.Deserialize <PublicTokenExchangeResponse>(rawResponse, SerializerOptions));
        }
Ejemplo n.º 2
0
 public PublicTokenExchangeResponse PublicTokenExchange(PublicTokenExchangeRequest request)
 {
     return(PublicTokenExchangeAsync(request).GetAwaiter().GetResult());
 }