Update teedy.ps1

working doc and tag creation
This commit is contained in:
paradizelost 2020-12-15 08:22:07 -06:00 committed by GitHub
parent 0962da2eee
commit 00547f0d6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -41,16 +41,22 @@ $tagtocreate = @{
color='#3a87ad'
}
$tagjson = $tagtocreate|ConvertTo-Json
Invoke-RestMethod -uri "$siteurl/api/tag" -Headers $headers -Method PUT -body $tagjson -ContentType "application/json"
Invoke-RestMethod -uri "$siteurl/api/tag" -Headers $headers -Method PUT -form $tagtocreate
$tagurlencode = [System.Web.HttpUtility]::UrlEncode($tagtocreate)
#Invoke-RestMethod -uri "$siteurl/api/tag" -Headers $headers -Method PUT -body $tagjson -ContentType "application/json"
#Invoke-RestMethod -uri "$siteurl/api/tag" -Headers $headers -Method PUT -form $tagtocreate
Invoke-RestMethod -uri "$siteurl/api/tag" -Headers $headers -Method PUT -body $tagtocreate -ContentType 'application/x-www-form-urlencoded'
#Invoke-RestMethod -uri "$siteurl/api/tag" -Headers $headers -Method PUT -body $tagurlencode -ContentType 'application/x-www-form-urlencoded'
$doctocreate=@{
title="testDoc";
language="eng";
}
$docjson = $doctocreate|ConvertTo-Json
$docurlencode = [System.Web.HttpUtility]::UrlEncode($doctocreate)
Invoke-RestMethod -uri "$siteurl/api/document" -Headers $headers -Method PUT -body $docjson -ContentType 'application/json'
Invoke-RestMethod -uri "$siteurl/api/document" -Headers $headers -Method PUT -form $doctocreate
#Invoke-RestMethod -uri "$siteurl/api/document" -Headers $headers -Method PUT -body $docjson -ContentType 'application/json'
Invoke-RestMethod -uri "$siteurl/api/document" -Headers $headers -Method PUT -body $doctocreate -ContentType 'application/x-www-form-urlencoded'
#Invoke-RestMethod -uri "$siteurl/api/document" -Headers $headers -Method PUT -form $doctocreate
#Invoke-RestMethod -uri "$siteurl/api/document" -Headers $headers -Method PUT -body $docurlencode -ContentType 'application/x-www-form-urlencoded'
$logoutresponse = Invoke-webrequest -Uri "$siteurl/api/user/logout" -Headers $headers -Method POST