POST Method Issue!!!

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
vinsanbu
Posts: 6
Joined: Thu Jun 22, 2017 12:32 pm

POST Method Issue!!!

Post by vinsanbu » Fri Jun 23, 2017 12:41 pm

Hi,

We tried to call our WebService using POST method. But we cant able to POST the data. Please find below my code and help me on this

put "test=success" into testdata
post testdata to URL "<MyURL>"
put it into tFormResults

We did not get any error. The above code executing without any issue. But we did not get the data in the Webservice. We are using Livecode Community Edition. Also this is Windows Application.

Regards,
Anbu

LiveCode_Panos
Livecode Staff Member
Livecode Staff Member
Posts: 818
Joined: Fri Feb 06, 2015 4:03 pm

Re: POST Method Issue!!!

Post by LiveCode_Panos » Fri Jun 23, 2017 12:50 pm

Hi vinsanbu,

This code snippet looks fine, but we need more info to find out why you are getting this result:

1. What is the value of <MyURL>?
2. From your description, I assume the "it" variable is empty. What is the value of "the result" function?

put "test=success" into testdata
post testdata to URL "<MyURL>"
put the result into tResult
put it into tFormResults

3. Do you see that problem on the Windows IDE, or in a Windows standalone?

Best,
Panos
--

vinsanbu
Posts: 6
Joined: Thu Jun 22, 2017 12:32 pm

Re: POST Method Issue!!!

Post by vinsanbu » Fri Jun 23, 2017 3:16 pm

Hi Panos,

Thanks for your reply. Please find the attached document for the your reference.

I have tried with your code. Its through the error message (its attached in the file).

Regards,
Anbuselvan
Attachments
LC01.png

SparkOut
Posts: 2852
Joined: Sun Sep 23, 2007 4:58 pm

Re: POST Method Issue!!!

Post by SparkOut » Fri Jun 23, 2017 3:40 pm

Might be resolution of "localhost" - what if you use 127.0.0.1 inplace?

vinsanbu
Posts: 6
Joined: Thu Jun 22, 2017 12:32 pm

Re: POST Method Issue!!!

Post by vinsanbu » Fri Jun 23, 2017 3:54 pm

I have tried with my IP address. Still same issue. I have doubt in formate the data to POST. Is there anything else?

LiveCode_Panos
Livecode Staff Member
Livecode Staff Member
Posts: 818
Joined: Fri Feb 06, 2015 4:03 pm

Re: POST Method Issue!!!

Post by LiveCode_Panos » Fri Jun 23, 2017 4:19 pm

Ah you probably have to urlEncode testdata first:

put "test=success" into testdata
put urlEncode(testdata) into tEncoded
post tEncoded to URL "<MyURL>"
put the result into tResult
put it into tFormResults

Does it now work?

vinsanbu
Posts: 6
Joined: Thu Jun 22, 2017 12:32 pm

Re: POST Method Issue!!!

Post by vinsanbu » Thu Jun 29, 2017 3:02 pm

Hi,

Thanks for you reply..

Still we have same issue.. Actually we are calling the WebApi. Can you please confirm it might be any issue? else do we need to change the code to call WebAPI?

Thanks
Anbu

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”