HttpDeleteJson - cJsonHttpTransfer
Executes an HTTP DELETE request using JSON data
Type: Function
Return Data Type: Handle
Parameters
| Parameter | Type | Description |
|---|---|---|
| sHost | String | The URL host (e.g. DataAccess.com - Note: DO NOT include the "HTTP://") |
| sFilePath | String | The file path and any data passed in a query string (e.g. MyJsonSite/JsonSrvc.asp?ID=A) |
| hoJsonRequest | Handle | The JSON request passed as a cJsonObject object. Pass 0 if none. DELETE may not pass JSON data. |
| ByRef bOk | Boolean | Returns True if the request was successful. |
Syntax
Function HttpDeleteJson String sHost String sFilePath Handle hoJsonRequest ByRef Boolean bOk Returns Handle
Call Example
Get HttpDeleteJson sHost sFilePath hoJsonRequest bOk to HandleVariable
Description
HttpDeleteJson performs a request using the DELETE HTTP verb. It performs the actual operation by calling the HttpVerbJson function.
Get HttpDeleteJson of oJsonHttp "jsonplaceholder.typicode.com" ("/comments/" + sId) 0 (&bOk) to hoJson
If (bOk) Begin
Send ShowInfoBox "Successfully deleted item."
If (hoJson) Begin
Send Destroy of hoJson
End
End
Else Begin
Get TransferErrorDescription of oJsonHttp to sErr
Send UserError sErr "Transfer failed!"
End
The JSON data passed and returned as UTF-8 data, which is what would be expected for JSON transfers over HTTP.
When a JSON response object is returned, it must be destroyed when it is no longer needed.
Return Value
The JSON response passed as a cJsonObject object. 0 if no data is returned. DELETE may not return JSON data.