#369 - Form encode paramaters when method == post/put and no other body present
This commit is contained in:
1 parent
09ef486aee
commit
2c1fd125e9
2 files changed
+31
-3
No files matched your search
@@ -281,4 +281,17 @@ RSpec.describe Google::Apis::Core::HttpCommand do
|
||||
command.query['b'] = false
|
||||
command.execute(client)
|
||||
end
|
||||
|
||||
it 'should form encode parameters when method is POST and no body present' do
|
||||
stub_request(:post, 'https://www.googleapis.com/zoo/animals')
|
||||
.with(body: 'a=1&a=2&a=3&b=hello&c=&d=0')
|
||||
.to_return(status: [200, ''])
|
||||
command = Google::Apis::Core::HttpCommand.new(:post, 'https://www.googleapis.com/zoo/animals')
|
||||
command.query['a'] = [1,2,3]
|
||||
command.query['b'] = 'hello'
|
||||
command.query['c'] = nil
|
||||
command.query['d'] = 0
|
||||
command.execute(client)
|
||||
end
|
||||
|
||||
end
|
||||
Reference in new issue
Block a user