Open daninus14 opened 3 days ago
Generally I agree that making Dexador work with more data structures by default would be a good thing, easier for users.
(for instance, passing hash-tables to set headers, instead of restricting to an alist. This didn't bother me enough yet to send a PR though)
If you have to interact with an API which only accepts url-encoded data and doesn't accept JSON then you have no choice but to do something like this. I think it makes sense that there should be a library that takes care of it.
Just for reference opened a ticket in quri#90 incorrectly. Moving to dexador now.
Basically dexador uses quri to encode post parameters which limits what we can pass as post parameters when making a request. A common example of a request is to encode a list of dictionary like structures, which is hard to do with quri which dexador uses.
I explain the problem below and also provide a scratch sample solution I can develop into a PR.
This is a copy paste from what I wrote over there:
This is a sample query which is difficult to do with quri:
For some data as follows (represented here with json for ease of understanding since there's no standard hash table representation in CL)
To pass this to quri, even if we have an association list
Does not work.
quri does not deal with converting from lists to a notation bracketed with indices, and it does not deal with embedded data at all.
Currently the valid association list can only be done by previously "flattening" the given data structure with the appropriate labels corresponding to the data.
This would need to be cleaned, but this is my working code that is working. It's scratch code, I haven't fully cleaned it up, but once I do I can add it as a PR or you can use this if you want as a starting point:
And here are the results
Originally posted by @daninus14 in https://github.com/fukamachi/quri/issues/90#issuecomment-2499271620