Read more

Webmock normalizes arrays in urls

Emanuel
June 07, 2017Software engineer at makandra GmbH

Typhoeus Show archive.org snapshot has a different way of representing array params in a get request than RestClient Show archive.org snapshot .

Illustration web development

Do you need DevOps-experts?

Your development team has a full backlog? No time for infrastructure architecture? Our DevOps team is ready to support you!

  • We build reliable cloud solutions with Infrastructure as code
  • We are experts in security, Linux and databases
  • We support your dev team to perform
Read more Show archive.org snapshot

Typhoeus: http://example.com/?foo[0]=1&foo[1]=2&foo[2]=3
RestClient: http://example.com/?foo[]=1&foo[]=2&foo[]=3

Webmock normalizes this url when matching to your stubs, so it is always http://example.com/?foo[]=1&foo[]=2&foo[]=3. This might lead to green tests, but in fact crashes in real world. Rack::Utils.build_nested_query might help to build a get request with Typhoeus manually if you need array urls without indexed keys.


Typhoeus is useful if you want to use parallel requests.

Posted by Emanuel to makandra dev (2017-06-07 09:32)