diff options
author | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2013-01-03 07:41:14 +0000 |
---|---|---|
committer | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2013-01-03 07:41:14 +0000 |
commit | 9e1b9e73145e00ea591bd1e0e9777625bad66dc9 (patch) | |
tree | c6563988970251cba763364bcddd33ac7fe23970 /sca-cpp/trunk/modules/wsgi/httputil.py | |
parent | 157ca678dee75e7881a0198425d0c8328f0bee04 (diff) |
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
Diffstat (limited to 'sca-cpp/trunk/modules/wsgi/httputil.py')
-rw-r--r-- | sca-cpp/trunk/modules/wsgi/httputil.py | 14 |
1 files changed, 14 insertions, 0 deletions
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)) |