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 UI/UX Design

UI/UX Design by makandra brand

We make sure that your target audience has the best possible experience with your digital product. You get:

  • Design tailored to your audience
  • Proven processes customized to your needs
  • An expert team of experienced designers
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)