1

We have been using Spock to hit endpoints in api tests - up until now, we have been able to use a map to construct a POST body for json endpoints.

But now we have an api with form params, with multiple parameters of the same name. Can't send in a map; can't build a simple Groovy object with 2 duplicate params.

Any ideas?

Thanks

orbfish
  • 7,381
  • 14
  • 58
  • 75

1 Answers1

3

It's been a while since I've used httpbuilder, but I think providing a list as the value works:

[name: ['one','two']] // ..?name=one&name=two
John Wagenleitner
  • 10,967
  • 1
  • 40
  • 39