예제 #1
0
 public static RestRequest AddHeaders(
     this RestRequest request,
     ITicketSettings settings)
 {
     request.AddHeader("Content-Type", settings.ContentType);
     return(request);
 }
예제 #2
0
 public static RestRequest AddQueryParameters(
     this RestRequest request,
     ITicketSettings settings,
     string origin,
     string destination)
 {
     request.AddQueryParameter("origin", origin);
     request.AddQueryParameter("destination", destination);
     foreach (var key in settings.Values.Keys)
     {
         request.AddQueryParameter(key, settings.Values[key]);
     }
     return(request);
 }
예제 #3
0
 public TicketSearcher(ITicketSettings searchSettings)
 {
     Settings = searchSettings
                ?? throw new System.ArgumentNullException(nameof(searchSettings));
     Client = new RestClient(Settings.Url);
 }