Back to Collection Items
Use ChilkatAx-win32.pkg
Procedure Test
Handle hoHttp
Boolean iSuccess
Variant vQueryParams
Handle hoQueryParams
Variant vResp
Handle hoResp
String sTemp1
Integer iTemp1
Boolean bTemp1
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
Get Create (RefClass(cComChilkatHttp)) To hoHttp
If (Not(IsComObjectCreated(hoHttp))) Begin
Send CreateComObject of hoHttp
End
Get Create (RefClass(cComChilkatJsonObject)) To hoQueryParams
If (Not(IsComObjectCreated(hoQueryParams))) Begin
Send CreateComObject of hoQueryParams
End
Get ComUpdateString Of hoQueryParams "includeRange" "true" To iSuccess
Get ComUpdateString Of hoQueryParams "includeFixed" "true" To iSuccess
// Adds the "Authorization: Bearer ACCESS_TOKEN_GOES_HERE" header.
Set ComAuthToken Of hoHttp To "ACCESS_TOKEN_GOES_HERE"
Send ComSetRequestHeader To hoHttp "Accept" "application/com.reloadly.giftcards-v1+json"
Get pvComObject of hoQueryParams to vQueryParams
Get ComQuickRequestParams Of hoHttp "GET" "https://giftcards.reloadly.com/products" vQueryParams To vResp
If (IsComObject(vResp)) Begin
Get Create (RefClass(cComChilkatHttpResponse)) To hoResp
Set pvComObject Of hoResp To vResp
End
Get ComLastMethodSuccess Of hoHttp To bTemp1
If (bTemp1 = False) Begin
Get ComLastErrorText Of hoHttp To sTemp1
Showln sTemp1
Procedure_Return
End
Get ComStatusCode Of hoResp To iTemp1
Showln iTemp1
Get ComBodyStr Of hoResp To sTemp1
Showln sTemp1
Send Destroy of hoResp
End_Procedure
Curl Command
curl -G -d "includeRange=true"
-d "includeFixed=true"
-H "Authorization: Bearer ACCESS_TOKEN_GOES_HERE"
-H "Accept: application/com.reloadly.giftcards-v1+json"
https://giftcards.reloadly.com/products
Postman Collection Item JSON
{
"name": "Products",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer ACCESS_TOKEN_GOES_HERE",
"type": "text"
},
{
"key": "Accept",
"value": "application/com.reloadly.giftcards-v1+json",
"type": "text"
}
],
"url": {
"raw": "https://giftcards.reloadly.com/products?includeRange=true&includeFixed=true",
"protocol": "https",
"host": [
"giftcards",
"reloadly",
"com"
],
"path": [
"products"
],
"query": [
{
"key": "includeRange",
"value": "true"
},
{
"key": "includeFixed",
"value": "true"
}
]
}
},
"response": [
]
}