content-type fix
This commit is contained in:
@@ -27,22 +27,20 @@ function Invoke-Request {
|
||||
if ($_tokenStatus -eq "Expired") { Update-Session }
|
||||
|
||||
$_uri = "$($script:psipamSession.URL)/api/$($script:psipamSession.AppID)/$Controller"
|
||||
if ($SubController -ne $null) { $_uri += "/$SubController" }
|
||||
if ($Identifiers -ne $null) { $_uri += "/$($Identifiers -join '/')/" }
|
||||
if ($null -ne $SubController) { $_uri += "/$SubController" }
|
||||
if ($null -ne $Identifiers) { $_uri += "/$($Identifiers -join '/')/" }
|
||||
|
||||
$_headers = @{
|
||||
"Accept" = "application/json"
|
||||
"Content-Type" = "application/json"
|
||||
}
|
||||
$_headers = @{ }
|
||||
switch ($script:psipamSession.AuthType) {
|
||||
"Credentials" { $_headers.Add("token", $script:psipamSession.Token) }
|
||||
"Token" { $_headers.Add("phpipam-token", $script:psipamSession.Token) }
|
||||
}
|
||||
|
||||
$_arguments = @{
|
||||
Method = $Method
|
||||
Uri = $_uri
|
||||
Headers = $_headers
|
||||
Method = $Method
|
||||
Uri = $_uri
|
||||
Headers = $_headers
|
||||
ContentType = "application/json"
|
||||
}
|
||||
|
||||
if ($Method -eq "POST" -or $Method -eq "PATCH") {
|
||||
|
||||
@@ -107,5 +107,6 @@ function New-Session {
|
||||
break
|
||||
}
|
||||
}
|
||||
return $script:psipamSession
|
||||
}
|
||||
Export-ModuleMember -Function New-Session
|
||||
Reference in New Issue
Block a user