internal HalHttpClient(IHalJsonParser parser, HttpClient httpClient) { _parser = parser ?? throw new ArgumentNullException(nameof(parser)); HttpClient = httpClient ?? throw new ArgumentNullException(nameof(httpClient)); Configuration = new HalHttpClientConfiguration(httpClient); }
public HalHttpClientFactory(IHalJsonParser parser) { if (parser == null) throw new ArgumentNullException("parser"); _parser = parser; }
public HalHttpClientFactory(IHalJsonParser parser) { if (parser == null) { throw new ArgumentNullException(nameof(parser)); } Parser = parser; }
internal HalHttpClient(IHalJsonParser parser, HttpClient client) { if (parser == null) { throw new ArgumentNullException("parser"); } _parser = parser; _client = client ?? new HttpClient(new HttpClientHandler { AllowAutoRedirect = false }); }
internal HalHttpClient(IHalJsonParser parser, HttpClient httpClient) { if (parser == null) { throw new ArgumentNullException(nameof(parser)); } if (httpClient == null) { throw new ArgumentNullException(nameof(httpClient)); } _parser = parser; _httpClient = httpClient; Configuration = new HalHttpClientConfiguration(httpClient); }
public FindsiHalHttpClientFactory(IHalJsonParser parser, IFindsiClientSettings settings) : base(parser) { if (settings == null) { throw new ArgumentNullException("settings"); } if (settings.BaseAddress == null) { throw new ArgumentException("Invalid api base address uri provided"); } if (string.IsNullOrEmpty(settings.Key)) { throw new ArgumentException("Invalid api key provided"); } _settings = settings; }
internal HalHttpClient(IHalJsonParser parser, HttpClient httpClient) { if (parser == null) { throw new ArgumentNullException(nameof(parser)); } if (httpClient == null) { throw new ArgumentNullException(nameof(httpClient)); } _parser = parser; _httpClient = httpClient; Configuration = new HalHttpClientConfiguration(httpClient); formatter = new System.Net.Http.Formatting.JsonMediaTypeFormatter(); formatter.SerializerSettings = new JsonSerializerSettings { Formatting = Formatting.Indented, ContractResolver = new CamelCasePropertyNamesContractResolver() }; }
public HalHttpClientFactory(IHalJsonParser parser) : base(parser) { }
public TestFactoryWrapper(IHalJsonParser parser) : base(parser) { }
protected HalHttpClientFactoryBase(IHalJsonParser parser) { HalJsonParser = parser ?? throw new ArgumentNullException(nameof(parser)); }
public HalHttpClientFactoryWithContext(IHalJsonParser parser) : base(parser) { }
public static async Task <IHalHttpResponseMessage> CreateAsync(HttpResponseMessage response, IHalJsonParser parser) { if (response == null) { throw new ArgumentNullException(nameof(response)); } if (parser == null) { throw new ArgumentNullException(nameof(parser)); } var message = new HalHttpResponseMessage(response); if (message.IsHalResponse) { var content = await response.Content.ReadAsStringAsync(); if (content.Length > 0) { var result = parser.Parse(content); message.Resource = new RootResourceObject(result); } else { message.Resource = new RootResourceObject(); } } return(message); }
protected HalHttpClientFactoryBase(IHalJsonParser parser) : base(parser) { }