Skip to content

Commit a046e26

Browse files
eumikhailovxuzhg
authored andcommitted

File tree

1 file changed

+46
-1
lines changed

1 file changed

+46
-1
lines changed

src/Microsoft.OData.Extensions.Client/Internals/Handlers/HttpClientRequestMessage.cs

+46-1
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,51 @@ public override ICredentials Credentials
150150
this.requestMessage.Properties[typeof(ICredentials).FullName] = value;
151151
}
152152
}
153+
154+
/// <summary>
155+
/// Gets or sets the timeout (in seconds) for this request.
156+
/// </summary>
157+
public override int Timeout
158+
{
159+
get
160+
{
161+
return (int)this.client.Timeout.TotalSeconds;
162+
}
163+
set
164+
{
165+
this.client.Timeout = new TimeSpan(0, 0, value);
166+
}
167+
}
168+
169+
public override int ReadWriteTimeout
170+
{
171+
get
172+
{
173+
return (int)this.client.Timeout.TotalSeconds;
174+
}
175+
set
176+
{
177+
this.client.Timeout = new TimeSpan(0, 0, value);
178+
}
179+
}
180+
181+
#if !(NETCOREAPP1_0 || NETCOREAPP2_0)
182+
/// <summary>
183+
/// Gets or sets a value that indicates whether to send data in segments to the Internet resource.
184+
/// </summary>
185+
public override bool SendChunked
186+
{
187+
get
188+
{
189+
bool? transferEncodingChunked = this.requestMessage.Headers.TransferEncodingChunked;
190+
return transferEncodingChunked.HasValue && transferEncodingChunked.Value;
191+
}
192+
set
193+
{
194+
this.requestMessage.Headers.TransferEncodingChunked = value;
195+
}
196+
}
197+
#endif
153198

154199
/// <summary>
155200
/// Returns the value of the header with the given name.
@@ -313,4 +358,4 @@ private static DataServiceTransportException ConvertToDataServiceWebException(We
313358
return new DataServiceTransportException(errorResponseMessage, webException);
314359
}
315360
}
316-
}
361+
}

0 commit comments

Comments
 (0)