From 9e1b9e73145e00ea591bd1e0e9777625bad66dc9 Mon Sep 17 00:00:00 2001 From: jsdelfino Date: Thu, 3 Jan 2013 07:41:14 +0000 Subject: Add support for HTTP patch and application of patch scripts to server and data store components. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1428192 13f79535-47bb-0310-9956-ffa450edef68 --- sca-cpp/trunk/modules/wsgi/httputil.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'sca-cpp/trunk/modules/wsgi/httputil.py') diff --git a/sca-cpp/trunk/modules/wsgi/httputil.py b/sca-cpp/trunk/modules/wsgi/httputil.py index 842460cc6a..f98418d0bc 100644 --- a/sca-cpp/trunk/modules/wsgi/httputil.py +++ b/sca-cpp/trunk/modules/wsgi/httputil.py @@ -124,6 +124,20 @@ class client: return None return True + # handle a PATCH request + if func == "patch": + u = requesturi(self.url, car(args)) + print >> stderr, "Client PATCH request", u + req = StringIO() + writeStrings(atomutil.writeATOMEntry(atomutil.entryValuesToElements(cadr(args))), req) + headers["Content-type"] = "application/atom+xml" + c.request("PATCH", u, req.getvalue(), headers) + res = c.getresponse() + print >> stderr, "Client status", res.status + if res.status != 200: + return None + return True + # handle a DELETE request if func == "delete": u = requesturi(self.url, car(args)) -- cgit v1.2.3