You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a specific API I want to access, that combines File-uploads with a different scheme of array encoding.
It's the API of the OpenSource DMS "Paperless-NGX" - They allow uploading a document file and specifying a list of tag-ids in multi format, e.g. "tags=1&tags=5&tags=10"
With params_encoding in [:none, :rack, :multi] -> In my case I would need multi.
But I didn't find a way to pass those encoding option down into the request.
I tried: Typhoeus.post(..., body: {}, params_encoding: :multi), but the whole code base of Typhoeus does not mention "params_encoding" at all, and I tried following the callchain into Ethon http_request / fabricate but found no obvious way.
In my case, the solution was to monkey patch Ethon:
I have a specific API I want to access, that combines File-uploads with a different scheme of array encoding.
See doc: https://docs.paperless-ngx.com/api/#file-uploads
Luckily, Ethon already supports those nested params format at https://github.com/typhoeus/ethon/blob/6b0260dd6f9bf3b6491d9c2ccab104b8b71db108/lib/ethon/easy/queryable.rb#L101
With
params_encoding
in [:none, :rack, :multi] -> In my case I would needmulti
.But I didn't find a way to pass those encoding option down into the request.
I tried:
Typhoeus.post(..., body: {}, params_encoding: :multi)
, but the whole code base of Typhoeus does not mention "params_encoding" at all, and I tried following the callchain into Ethon http_request / fabricate but found no obvious way.In my case, the solution was to monkey patch Ethon:
Maybe I overlooked the option?
The text was updated successfully, but these errors were encountered: