From 44228c0c7bf80f0f4998aaad29b08fe0fffba52a Mon Sep 17 00:00:00 2001 From: Pradeep Sathasivam Date: Wed, 2 Mar 2016 12:34:17 +0530 Subject: [PATCH] Support to send body in DELETE request --- pyresttest/tests.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyresttest/tests.py b/pyresttest/tests.py index d1ce09af..8cb613bd 100644 --- a/pyresttest/tests.py +++ b/pyresttest/tests.py @@ -350,7 +350,8 @@ def configure_curl(self, timeout=DEFAULT_TIMEOUT, context=None, curl_handle=None elif self.method == u'DELETE': curl.setopt(curl.CUSTOMREQUEST, 'DELETE') if bod is not None: - curl.setopt(pycurl.INFILESIZE, len(bod)) + curl.setopt(pycurl.POSTFIELDS, bod) + curl.setopt(pycurl.POSTFIELDSIZE, len(bod)) elif self.method == u'HEAD': curl.setopt(curl.NOBODY, 1) curl.setopt(curl.CUSTOMREQUEST, 'HEAD')