clj-commons/clj-http-lite

Unexpected nested form-params treatment

lread opened this issue · 2 comments

lread commented

See hiredman#15

I expect we could figure this out, maybe?

I'll take a peek.

lread commented

Ah. clj-http added special controls for flattening nested query and form params in v3.8.0 (about 5 years ago). I'll explore if bringing that work over is possible.

lread commented

A difference between clj-http-lite and clj-http:

  • clj-http-lite - :form-params are always URL encoded in the body.
  • clj-http does - is the same by default but also looks at :content-type to encode :form-params to, for example json, edn, transit.

(This is probably worth a mention under differences in the README.)

It also means that we might not need the extra config options for nested params that clj-http offers. It has

  • :ignore-nested-query-string which defaults to false
  • :flatten-nested-form-params which defaults to false.
  • It also has :flatten-nested-keys which is is a converted expression of these same 2 options.

By design, we have so many fewer knobs to turn than clj-http.
I think we could get away with always flattening nested form and query params.
If this turns out to be false we can adapt at a later date.