PUT/DELETE methods

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Gurgen
Posts: 34
Joined: Thu Dec 10, 2015 2:09 pm

PUT/DELETE methods

Post by Gurgen » Mon Jun 06, 2016 6:08 pm

Hi,

I'm trying to bring Gravity Forms web API into Livecode. There is some requests, that requires to use PUT and DELETE methods.
If you do a PUT/DELETE then you ONLY get a response if there is an error(it is always empty). So is there any way to get response for PUT and DELETE like for POST and GET?

Thanks
Gurgen

ToddFabacher
Posts: 280
Joined: Fri Jan 09, 2015 6:15 pm

Re: PUT/DELETE methods

Post by ToddFabacher » Mon Jun 06, 2016 6:18 pm

You did not put up a code sample...so are you putting the syntax like this??

Code: Select all

  put "you URL and parameters here" into tURL 
  put URL tURL into  tPutResults
  put the result into tError
--Todd

Gurgen
Posts: 34
Joined: Thu Dec 10, 2015 2:09 pm

Re: PUT/DELETE methods

Post by Gurgen » Mon Jun 06, 2016 6:30 pm

ToddFabacher wrote:You did not put up a code sample...so are you putting the syntax like this??

Code: Select all

  put "you URL and parameters here" into tURL 
  put URL tURL into  tPutResults
  put the result into tError
--Todd
Thank you Todd, no my syntax is

For PUT

Code: Select all

PUT <my data> into URL <my URL>
put the result into tError

And for DELETE

Code: Select all

DELETE URL <my URL>
put the result into tError

ToddFabacher
Posts: 280
Joined: Fri Jan 09, 2015 6:15 pm

Re: PUT/DELETE methods

Post by ToddFabacher » Mon Jun 06, 2016 6:33 pm

A full HTTP put command would be like this.

Code: Select all

// server must be able to process PUT
put tData into URL "[your URL]"
put the result into tError
if tError is not empty then
  beep
  answer "error; " & tError
end if
Two things: 1. There is no "success" response in LiveCode that I am aware of and 2. You should test this in Android, I don't think it works.

--Todd

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”