Visit The New, Modern Unix Linux Community


Calling RESTful web services from Unix ?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Calling RESTful web services from Unix ?
# 1  
Calling RESTful web services from Unix ?

Hello,

I need to make a function call to a RESTful web service. I tried using curl command but it throws an error 'Mathod not allowed'

curl --request POST <link>

Could someone confirm if Unix can call a RESTful web service and share some examples around the Syntax

Thanks in Advance Smilie !!!

- Amit
# 2  
Yes. You can use curl to talk to webservices.

You haven't provided much information so what follows is my best guess.

The error message you're seeing is an HTTP 405 response. The particular resource addressed in your URL does not support the POST method. If the server response is HTTP compliant, it should include an "Allow" header enumerating which methods are allowed (GET, PUT, or perhaps some custom methods).

If this guess-analysis is incorrect or you require more detailed help, provide more detailed info. For example, if this is a public url, provide that. Provide your actual curl command in its entirety. Provide the headers sent and received.

Regards,
Alister
# 3  
Thanks Alister. That was helpful.

I ended up with following command which worked for me:

echo '<parameters><taskName>TestTask</taskName></parameters>' | curl -u usernamSmilieassword -X POST -H 'Content-type: text/xml' -d @- <URL>

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #625
Difficulty: Medium
Functions are defined using the defineFunction reserved keyword in Python.
True or False?

Featured Tech Videos