Private Sub SetHeaderValue(ByVal header As WebHeaderCollection, ByVal name As String, ByVal value As String)
Dim [property] = GetType(WebHeaderCollection).GetProperty("InnerCollection", Reflection.BindingFlags.Instance Or Reflection.BindingFlags.NonPublic)
If [property] IsNot Nothing Then
Dim collection As NameValueCollection = [property].GetValue(header, Nothing)
collection(name) = value
End If
End Sub
If item.KeepAlive Then
SetHeaderValue(request.Headers, "Connection", "Keep-Alive")
Else
request.KeepAlive = item.KeepAlive
End If