Back to Collection Items
func chilkatTest() {
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
let http = CkoHttp()!
var success: Bool
http.basicAuth = true
http.login = "{{webservice_key}}"
http.password = "password"
let sbResponseBody = CkoStringBuilder()!
success = http.quickGetSb("https://localhost:8080/api/products", sbContent: sbResponseBody)
if success == false {
print("\(http.lastErrorText!)")
return
}
print("Response status code = \(http.lastStatus.intValue)")
print("\(sbResponseBody.getAsString()!)")
}
Curl Command
curl -X GET
-u '{{webservice_key}}:password'
https://localhost:8080/api/products
Postman Collection Item JSON
{
"name": "Get all products",
"request": {
"method": "GET",
"header": [
],
"url": {
"raw": "{{webservice_url}}/api/products",
"host": [
"{{webservice_url}}"
],
"path": [
"api",
"products"
]
}
},
"response": [
]
}