Skip to content

Commit 4f6e41e

Browse files
committed
Sync open source content 🐝 (from 35fcb5c94dddde8da1b5c9d417396a22bbb15535)
1 parent 79c79ae commit 4f6e41e

File tree

2 files changed

+8
-20
lines changed

2 files changed

+8
-20
lines changed

docs/customize/runtime/custom-http-client.mdx

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -107,21 +107,9 @@ SDK sdk = builder.build();
107107
```
108108

109109
```csharp !!tabs C#
110-
//----------------------------------------------------
111-
// <summary>
112-
// The C# SDK accepts a client that implements
113-
// the `Utils.IDefaultHttpClient` interface.
114-
//
115-
// Note: In some SDKs this interface may be called
116-
// `ISpeakeasyHttpClient`, which can be rebranded
117-
// as `I<Prefix>HttpClient` by configuring the
118-
// `httpClientPrefix` setting in your `gen.yaml`.
119-
// </summary>
120-
//----------------------------------------------------
121-
122-
// YourHttpClient must implement Utils.IDefaultHttpClient
123-
var httpClient = new YourHttpClient();
110+
/* YourHttpClient must implement the ISpeakeasyHttpClient interface */
124111

112+
var httpClient = new YourHttpClient();
125113
// Initialize the SDK with the custom HTTP client
126114
var sdk = new SDK(client: httpClient);
127115
```

docs/languages/csharp/methodology-csharp.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,16 @@ The SDK includes minimal dependencies. The only external dependencies are:
6161

6262
## HTTP Client
6363

64-
By default, the C# SDK will instantiate its own `DefaultHttpClient`, which uses the `System.Net.HttpClient` under the hood. The default client can be overridden by passing a custom HTTP client when initializing the SDK:
64+
By default, the C# SDK will instantiate its own `SpeakeasyHttpClient`, which uses the `System.Net.HttpClient` under the hood. The default client can be overridden by passing a custom HTTP client when initializing the SDK:
6565
```csharp
6666
var sdk = new SDK(client: new CustomHttpClient());
6767
```
6868

69-
The provided HTTP client must implement the `Utils.IDefaultHttpClient` interface:
69+
The provided HTTP client must implement the `ISpeakeasyHttpClient` interface as defined in `Utils.SpeakeasyHttpClient.cs`:
7070
```csharp
7171
using <NameSpace>.Utils;
7272

73-
public class CustomHttpClient : IDefaultHttpClient
73+
public class CustomHttpClient : ISpeakeasyHttpClient
7474
{
7575
public CustomHttpClient()
7676
{
@@ -105,13 +105,13 @@ public class CustomHttpClient : IDefaultHttpClient
105105

106106
This is useful if you're using a custom HTTP client that supports proxy settings or other custom configuration.
107107

108-
In the example below, a custom client inherits from the internal `DefaultHttpClient` class, which implements the `IDefaultHttpClient` interface. This client adds a header to all requests before sending them:
108+
In the example below, a custom client inherits from the internal `SpeakeasyHttpClient` class, which implements the `ISpekeasyHttpClient` interface. This client adds a header to all requests before sending them:
109109
```csharp
110110
using <NameSpace>.Utils;
111111

112-
internal class CustomHttpClient : DefaultHttpClient
112+
internal class CustomSpeakeasyHttpClient : SpeakeasyHttpClient
113113
{
114-
public CustomHttpClient() {}
114+
public CustomSpeakeasyHttpClient() {}
115115

116116
public override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request)
117117
{

0 commit comments

Comments
 (0)