Skip to content

Commit

Permalink
Fix HttpClientRequestMessage.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
eumikhailov authored and xuzhg committed Aug 14, 2020
1 parent ca57a94 commit a046e26
Showing 1 changed file with 46 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,51 @@ public override ICredentials Credentials
this.requestMessage.Properties[typeof(ICredentials).FullName] = value;
}
}

/// <summary>
/// Gets or sets the timeout (in seconds) for this request.
/// </summary>
public override int Timeout
{
get
{
return (int)this.client.Timeout.TotalSeconds;
}
set
{
this.client.Timeout = new TimeSpan(0, 0, value);
}
}

public override int ReadWriteTimeout
{
get
{
return (int)this.client.Timeout.TotalSeconds;
}
set
{
this.client.Timeout = new TimeSpan(0, 0, value);
}
}

#if !(NETCOREAPP1_0 || NETCOREAPP2_0)
/// <summary>
/// Gets or sets a value that indicates whether to send data in segments to the Internet resource.
/// </summary>
public override bool SendChunked
{
get
{
bool? transferEncodingChunked = this.requestMessage.Headers.TransferEncodingChunked;
return transferEncodingChunked.HasValue && transferEncodingChunked.Value;
}
set
{
this.requestMessage.Headers.TransferEncodingChunked = value;
}
}
#endif

/// <summary>
/// Returns the value of the header with the given name.
Expand Down Expand Up @@ -313,4 +358,4 @@ private static DataServiceTransportException ConvertToDataServiceWebException(We
return new DataServiceTransportException(errorResponseMessage, webException);
}
}
}
}

0 comments on commit a046e26

Please sign in to comment.