RelationalAI / rai-sdk-csharp

The RelationalAI Software Development Kit (SDK) for C#
Apache License 2.0
0 stars 1 forks source link

Expose http client #39

Closed NRHelmi closed 2 years ago

NRHelmi commented 2 years ago

This PR exposes the sdk http client, this is useful for changing the http client properties Adds the ability to set http custom headers

...
var client = new Client(context);
var httpClient = client.GetHttpClient();
httpClient.DefaultRequestHeaders.Add("h1", "v1");

// set a new http client
// default properties of http client cannot be updated 
// thus a new http client might be useful
var httpClient = new HttpClient();

// change the http client properties
...
client.SetHttpClient(httpClient);
miazamrai commented 2 years ago

@NRHelmi I think we should keep the PR focused on the custom headers and the http client. We can remove the create engine with version function in a different PR so that we can hold it until we change the clients. Also I would suggest to remove the function in phases, like deprecate first for a certain time and then remove.