Back to Collection Items
integer li_rc
oleobject loo_Http
integer li_Success
oleobject loo_Req
oleobject loo_JsonParam1
oleobject loo_Resp
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
loo_Http = create oleobject
// Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0
li_rc = loo_Http.ConnectToNewObject("Chilkat.Http")
if li_rc < 0 then
destroy loo_Http
MessageBox("Error","Connecting to COM object failed")
return
end if
loo_Http.BasicAuth = 1
loo_Http.Login = "username"
loo_Http.Password = "password"
loo_Req = create oleobject
// Use "Chilkat_9_5_0.HttpRequest" for versions of Chilkat < 10.0.0
li_rc = loo_Req.ConnectToNewObject("Chilkat.HttpRequest")
loo_JsonParam1 = create oleobject
// Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
li_rc = loo_JsonParam1.ConnectToNewObject("Chilkat.JsonObject")
loo_Req.AddParam("token",loo_JsonParam1.Emit())
loo_Resp = loo_Http.PostUrlEncoded("https://domain.com/",loo_Req)
if loo_Http.LastMethodSuccess = 0 then
Write-Debug loo_Http.LastErrorText
destroy loo_Http
destroy loo_Req
destroy loo_JsonParam1
return
end if
Write-Debug string(loo_Resp.StatusCode)
Write-Debug loo_Resp.BodyStr
destroy loo_Resp
destroy loo_Http
destroy loo_Req
destroy loo_JsonParam1
Curl Command
curl -X POST
-u 'username:password'
-H "Content-Type: application/x-www-form-urlencoded"
--data-urlencode 'token={{partner_token}}'
https://domain.com/
Postman Collection Item JSON
{
"name": "[Partner] Revoke Partner Authentication Token",
"event": [
{
"listen": "test",
"script": {
"id": "7252b9c5-c9f3-49bc-a6a9-30e20a9cde88",
"exec": [
""
],
"type": "text/javascript"
}
}
],
"_postman_id": "d8f51948-6995-4924-bd4d-d011c5c8aa5f",
"request": {
"auth": {
"type": "basic",
"basic": {
"username": "{{partner_client_id}}",
"password": "{{partner_client_secret}}",
"showPassword": false
}
},
"method": "POST",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"type": "text",
"value": "application/x-www-form-urlencoded",
"disabled": true
}
],
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "token",
"value": "{{partner_token}}",
"type": "text"
}
]
},
"url": "{{api_host}}/oauth2/v1/token/revocation"
},
"response": [
]
}