Chilkat Online Tools

TCL / Reloadly API / Countries

Back to Collection Items

load ./chilkat.dll

# This example assumes the Chilkat API to have been previously unlocked.
# See Global Unlock Sample for sample code.

set http [new_CkHttp]

# Adds the "Authorization: Bearer ACCESS_TOKEN_GOES_HERE" header.
CkHttp_put_AuthToken $http "ACCESS_TOKEN_GOES_HERE"
CkHttp_SetRequestHeader $http "Accept" "application/com.reloadly.topups-v1+json"

set sbResponseBody [new_CkStringBuilder]

set success [CkHttp_QuickGetSb $http "https://topups.reloadly.com/countries" $sbResponseBody]
if {$success == 0} then {
    puts [CkHttp_lastErrorText $http]
    delete_CkHttp $http
    delete_CkStringBuilder $sbResponseBody
    exit
}

puts "Response status code = [CkHttp_get_LastStatus $http]"
puts [CkStringBuilder_getAsString $sbResponseBody]

delete_CkHttp $http
delete_CkStringBuilder $sbResponseBody

Curl Command

curl -X GET
	-H "Authorization: Bearer ACCESS_TOKEN_GOES_HERE"
	-H "Accept: application/com.reloadly.topups-v1+json"
https://topups.reloadly.com/countries

Postman Collection Item JSON

{
  "name": "Countries",
  "request": {
    "method": "GET",
    "header": [
      {
        "key": "Authorization",
        "value": "Bearer ACCESS_TOKEN_GOES_HERE",
        "type": "text"
      },
      {
        "key": "Accept",
        "value": "application/com.reloadly.topups-v1+json",
        "type": "text"
      }
    ],
    "url": {
      "raw": "https://topups.reloadly.com/countries",
      "protocol": "https",
      "host": [
        "topups",
        "reloadly",
        "com"
      ],
      "path": [
        "countries"
      ]
    }
  },
  "response": [
  ]
}