06-28-2017 02:26 PM
I have developed a webscript in alfresco:
/settaskstatus?taskID=491389&status=Completed
which sets status of a task based on it's ID.
I am trying to call this web script upon click of a button in ruby(erb)
<%=button_to "Completed", "https://plxcas140.pdx.intel.com:8443/alfresco/service/settaskstatus?taskID=491389&status=Completed"%>
It shows the following error:
06-28-2017 03:25 PM
That means the webscript you created is not able to deal with the POST method.
Much probably you have only the GET method.
Can you share here the webscript's code?
Remember to share everything you have (xml, ftl, js, java, whatever)
06-28-2017 04:02 PM
Hello,
I changed the name of my script from settaskstatus.get.js to settaskstatus.post.js and then the button worked.
Can you explain the reason behind it and what if I want to call a GET request
06-28-2017 04:14 PM
You can find all the explanation in the official docs here Web scripts | Alfresco Documentation
Now, short answer to you "what if I want to call a GET request", in that case you have to configure Ruby to use the GET method instead of the POST, but for that, I have nothing to say, as I know nothing about Ruby.
It seems, by your sample code, that Ruby uses POST as default.
06-28-2017 04:22 PM
okay thanks
Explore our Alfresco products with the links below. Use labels to filter content by product module.