I have a REST service I'm trying to call. This requires something similar to the following syntax:
http://someServerName:8080/projectName/service/serviceName/
param1Name/param1/param2Name/param2
I need to connect to it using POST. I tried reading it on the Internet ( here and here , for example) ... but this is my problem:
If I try to use the HTTP request request method by creating my own path, for example:
BASE_PATH = "http://someServerName:8080/projectName/service/serviceName/"
urllib.urlopen(BASE_PATH + "param1/" + param1 + "/param2/" + param2)
this gives me an error saying that GET is not allowed.
If I try to use the HTTP post request method, for example:
params = { "param1" : param1, "param2" : param2 }
urllib.urlopen(BASE_PATH, urllib.urlencode(params))
it returns a 404 error along with the message The requested resource () is not available.And when I debug this, it seems to build params in the query string ("param1 = whatever & param2 = whatever" ...)
POST, , , ? ?