Hi pink,
I could not get the DELETE request via tsNetCustomSync working , however mayby in your case it works because I get a server error which could not be a code issue.
For more information on the tsNet functionality see:
https://www.techstrategies.com.au/tsnet-command-list/
I have the following code.
Code: Select all
put "http://localhost:3001/api/v1/system/remove-documents" into tURLString
------------------------------------------------
put tDocumentName into aSettings["names"] // Want to delete a document
put "DELETE" into tRequest
------------------------------------------------
-- Prepare headers, in Headers do not use crlf but use lf
put "Content-Type: application/json" & lf & \
"accept: application/json" & lf & \
"Authorization: Bearer " & tApiKey into tHeaders
------------------------------------------------------------------
put tHeaders into tPrePostHeaders // Just for keeping track
------------------------------------------------------------------
# Make the API call using TSNet
put "" into field "InfoWindow" // empty field first
tsNetSetDebugCallback("updateDebugField") // For Debugging
tsNetInit
put tsNetCustomSync(tURLString, tRequest, tHeaders, tRecvHeaders, tResult, tBytes,aSettings) into tData
tsNetClose
The debug function is below and it puts the debug information into a field.
Code: Select all
on updateDebugField pConnId, pMessage
put pConnId & ":" && pMessage after field "InfoWindow"
put the formattedHeight of field "responseField" into tScroll
set the vScroll of field "responseField" to tScroll
end updateDebugField
Regards,
Paul