Back to Collection Items
LOCAL loHttp
LOCAL lnSuccess
LOCAL loReq
LOCAL loJsonParam1
LOCAL loResp
* This example assumes the Chilkat API to have been previously unlocked.
* See Global Unlock Sample for sample code.
* For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.Http')
loHttp = CreateObject('Chilkat.Http')
loHttp.BasicAuth = 1
loHttp.Login = "username"
loHttp.Password = "password"
* For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.HttpRequest')
loReq = CreateObject('Chilkat.HttpRequest')
* For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.JsonObject')
loJsonParam1 = CreateObject('Chilkat.JsonObject')
loReq.AddParam("token",loJsonParam1.Emit())
loResp = loHttp.PostUrlEncoded("https://domain.com/",loReq)
IF (loHttp.LastMethodSuccess = 0) THEN
? loHttp.LastErrorText
RELEASE loHttp
RELEASE loReq
RELEASE loJsonParam1
CANCEL
ENDIF
? STR(loResp.StatusCode)
? loResp.BodyStr
RELEASE loResp
RELEASE loHttp
RELEASE loReq
RELEASE loJsonParam1
Curl Command
curl -X POST
-u 'username:password'
-H "Content-Type: application/x-www-form-urlencoded"
--data-urlencode 'token={{lender_token}}'
https://domain.com/
Postman Collection Item JSON
{
"name": "[Lender] Introspect Lender Authentication Token",
"event": [
{
"listen": "test",
"script": {
"id": "7252b9c5-c9f3-49bc-a6a9-30e20a9cde88",
"exec": [
""
],
"type": "text/javascript"
}
}
],
"_postman_id": "be8240d3-76ef-47f3-8125-18dcf621c1dc",
"request": {
"auth": {
"type": "basic",
"basic": {
"username": "{{lender_client_id}}",
"password": "{{lender_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": "{{lender_token}}",
"type": "text"
}
]
},
"url": "{{api_host}}/oauth2/v1/token/introspection"
},
"response": [
]
}