Back to Collection Items
require 'chilkat'
# This example assumes the Chilkat API to have been previously unlocked.
# See Global Unlock Sample for sample code.
http = Chilkat::CkHttp.new()
http.put_BasicAuth(true)
http.put_Login("username")
http.put_Password("password")
req = Chilkat::CkHttpRequest.new()
jsonParam1 = Chilkat::CkJsonObject.new()
req.AddParam("token",jsonParam1.emit())
# resp is a CkHttpResponse
resp = http.PostUrlEncoded("https://domain.com/",req)
if (http.get_LastMethodSuccess() == false)
print http.lastErrorText() + "\n";
exit
end
print resp.get_StatusCode().to_s() + "\n";
print resp.bodyStr() + "\n";
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": [
]
}