Back to Collection Items
; This example assumes the Chilkat API to have been previously unlocked.
; See Global Unlock Sample for sample code.
$oHttp = ObjCreate("Chilkat.Http")
Local $bSuccess
$oHttp.BasicAuth = True
$oHttp.Login = "{{webservice_key}}"
$oHttp.Password = "password"
$oSbResponseBody = ObjCreate("Chilkat.StringBuilder")
$bSuccess = $oHttp.QuickGetSb("https://localhost:8080/api/products/1",$oSbResponseBody)
If ($bSuccess = False) Then
ConsoleWrite($oHttp.LastErrorText & @CRLF)
Exit
EndIf
ConsoleWrite("Response status code = " & $oHttp.LastStatus & @CRLF)
ConsoleWrite($oSbResponseBody.GetAsString() & @CRLF)
Curl Command
curl -X GET
-u '{{webservice_key}}:password'
https://localhost:8080/api/products/1
Postman Collection Item JSON
{
"name": "Get product",
"request": {
"method": "GET",
"header": [
],
"url": {
"raw": "{{webservice_url}}/api/products/{{product_id}}",
"host": [
"{{webservice_url}}"
],
"path": [
"api",
"products",
"{{product_id}}"
]
}
},
"response": [
]
}