PowerBuilder / Creatio API / Delete a field of an object collection instance
Back to Collection Items
integer li_rc
oleobject loo_Http
integer li_Success
oleobject loo_Resp
integer li_RespStatusCode
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
loo_Http = create oleobject
// Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0
li_rc = loo_Http.ConnectToNewObject("Chilkat.Http")
if li_rc < 0 then
destroy loo_Http
MessageBox("Error","Connecting to COM object failed")
return
end if
loo_Http.SetRequestHeader("Content-Type","application/octet-stream; IEEE754Compatible=true")
loo_Http.SetRequestHeader("BPMCSRF","{{BPMCSRF}}")
loo_Http.SetRequestHeader("Accept","application/json; text/plain; */*")
loo_Resp = loo_Http.QuickRequest("DELETE","https://myserver.com/0/odata/Collection4(Id)/Field4")
if loo_Http.LastMethodSuccess = 0 then
Write-Debug loo_Http.LastErrorText
destroy loo_Http
return
end if
li_RespStatusCode = loo_Resp.StatusCode
Write-Debug "Response Status Code = " + string(li_RespStatusCode)
if li_RespStatusCode <> 204 then
Write-Debug "Response Header:"
Write-Debug loo_Resp.Header
Write-Debug "Response Body:"
Write-Debug loo_Resp.BodyStr
Write-Debug "Failed."
destroy loo_Resp
destroy loo_Http
return
end if
destroy loo_Resp
Write-Debug "Success."
destroy loo_Http
Curl Command
curl -X DELETE
-H "Accept: application/json; text/plain; */*"
-H "Content-Type: application/octet-stream; IEEE754Compatible=true"
-H "BPMCSRF: {{BPMCSRF}}"
https://myserver.com/0/odata/Collection4(Id)/Field4
Postman Collection Item JSON
{
"name": "Delete a field of an object collection instance",
"event": [
{
"listen": "test",
"script": {
"exec": [
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "DELETE",
"header": [
{
"key": "Accept",
"value": "application/json; text/plain; */*",
"type": "text"
},
{
"key": "Content-Type",
"value": "application/octet-stream; IEEE754Compatible=true",
"type": "text"
},
{
"key": "BPMCSRF",
"value": "{{BPMCSRF}}",
"type": "text"
}
],
"url": {
"raw": "{{BaseURI}}/0/odata/{{CollectionName4}}({{ObjectId2}})/{{FieldName4}}",
"host": [
"{{BaseURI}}"
],
"path": [
"0",
"odata",
"{{CollectionName4}}({{ObjectId2}})",
"{{FieldName4}}"
]
},
"description": "Request for deleting a field of an object collection instance."
},
"response": [
{
"name": "[204] Deletes an object collection instance",
"originalRequest": {
"method": "DELETE",
"header": [
{
"key": "Accept",
"value": "application/json; text/plain; */*",
"type": "text"
},
{
"key": "Content-Type",
"value": "application/octet-stream; IEEE754Compatible=true",
"type": "text"
},
{
"key": "BPMCSRF",
"value": "{{BPMCSRF}}",
"type": "text"
}
],
"url": {
"raw": "https://myserver.com/0/odata/SysImage(29FE7EDF-4DB9-4E09-92B0-018047BA1F71)/Data",
"protocol": "https",
"host": [
"myserver",
"com"
],
"path": [
"0",
"odata",
"SysImage(29FE7EDF-4DB9-4E09-92B0-018047BA1F71)",
"Data"
]
}
},
"status": "No Content",
"code": 204,
"_postman_previewlanguage": "Text",
"header": [
],
"cookie": [
],
"body": ""
}
]
}