cancel
Showing results for 
Search instead for 
Did you mean: 

Calling POST webscript in ruby

sakshik
Star Contributor
Star Contributor

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:

4 REPLIES 4

douglascrp
World-Class Innovator
World-Class Innovator

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)

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

douglascrp
World-Class Innovator
World-Class Innovator

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.

okay thanks Smiley Happy