Skip to content

Commit

Permalink
WebRequest: Enable DisableKeepAlive for HTTP connection
Browse files Browse the repository at this point in the history
it will recreate a TCP connection but it is more fast... (timer when use same HTTP connection?)
  • Loading branch information
alagoutte committed Oct 3, 2018
1 parent 004f0fb commit 93172b1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions PowerArubaSW/Private/Webrequest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ function Invoke-ArubaSWWebRequest(){

try {
if($body){
$response = Invoke-WebRequest $fullurl -Method $method -body ($body | ConvertTo-Json) -Websession $sessionvariable
$response = Invoke-WebRequest $fullurl -Method $method -body ($body | ConvertTo-Json) -Websession $sessionvariable -DisableKeepAlive
} else {
$response = Invoke-WebRequest $fullurl -Method $method -Websession $sessionvariable
$response = Invoke-WebRequest $fullurl -Method $method -Websession $sessionvariable -DisableKeepAlive
}
}
catch {
Expand Down
2 changes: 1 addition & 1 deletion PowerArubaSW/Public/Connection.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function Connect-ArubaSW {
}

try {
$response = Invoke-WebRequest $url -Method POST -Body ($postParams | Convertto-Json ) -SessionVariable arubasw
$response = Invoke-WebRequest $url -Method POST -Body ($postParams | Convertto-Json ) -SessionVariable arubasw -DisableKeepAlive
}
catch {
#$_
Expand Down

0 comments on commit 93172b1

Please sign in to comment.