Page 1 of 1

PUT/DELETE methods

Posted: Mon Jun 06, 2016 6:08 pm
by Gurgen
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

Re: PUT/DELETE methods

Posted: Mon Jun 06, 2016 6:18 pm
by ToddFabacher
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

Re: PUT/DELETE methods

Posted: Mon Jun 06, 2016 6:30 pm
by Gurgen
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

Re: PUT/DELETE methods

Posted: Mon Jun 06, 2016 6:33 pm
by ToddFabacher
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