From f4ac92d40f918ce2c2c1ce9e8b02b2b65fdc7d11 Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Tue, 7 Dec 2010 20:24:40 +0800 Subject: [PATCH] only use raw body for POST and PUT requests --- hurl.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hurl.rb b/hurl.rb index 96f449e..f73e071 100644 --- a/hurl.rb +++ b/hurl.rb @@ -147,8 +147,8 @@ def initialize(*args) add_headers_from_arrays(curl, params["header-keys"], params["header-vals"]) # arbitrary post params - if params['post-body'] - post_data = Array(params['post-body']) + if params['post-body'] && ['POST', 'PUT'].index(method) + post_data = [params['post-body']] else post_data = make_fields(method, params["param-keys"], params["param-vals"]) end