POST Method Issue!!!
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
POST Method Issue!!!
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
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 Staff Member
- Posts: 818
- Joined: Fri Feb 06, 2015 4:03 pm
Re: POST Method Issue!!!
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
--
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
--
Re: POST Method Issue!!!
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
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
Re: POST Method Issue!!!
Might be resolution of "localhost" - what if you use 127.0.0.1 inplace?
Re: POST Method Issue!!!
I have tried with my IP address. Still same issue. I have doubt in formate the data to POST. Is there anything else?
-
- Livecode Staff Member
- Posts: 818
- Joined: Fri Feb 06, 2015 4:03 pm
Re: POST Method Issue!!!
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?
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?
Re: POST Method Issue!!!
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
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