Quantcast
Channel: LiveCode Forums
Viewing all articles
Browse latest Browse all 794

Internet • Re: Delete URL with data (and Patch)

$
0
0
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:

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:

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 tScrollend updateDebugField
Regards,

Paul

Statistics: Posted by mrcoollion — Tue Jan 21, 2025 2:13 pm



Viewing all articles
Browse latest Browse all 794

Trending Articles