Parameters should be Map<String, Any?>
See original GitHub issueIn my opinion, the parameter
argument in the httpGet()
,httpPost()
ect. should be of type Map<String, Any?>
.
Kotlin allows you, to convert List<Pair>>
to Map
like this:
val myMap = parameters.toMap()
Why not use Map
instead of List<Pair>
?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:7
Top Results From Across the Web
How to pass Map<String, Any> as parameter using Retrofit2?
The working solution is to make com.google.gson.JsonObject by mapping all fields from my model (instead of passing Map<String, Any> ), but it is ......
Read more >Map or String: what do I have to use?
Using a map like that obfuscates the parameters, making it so developers have to read the method to know what parameters to use....
Read more >Headers (Java SE 19 & JDK 19) - Oracle Help Center
Returns the first value from the List of String values for the given key , or null if no mapping for the key...
Read more >Dataset Class - Microsoft Learn
Dataset, setParameters(Map<String,ParameterSpecification> parameters). Set the parameters property: Parameters for dataset. ; Dataset, setSchema(Object schema).
Read more >Map Class | Apex Reference Guide - Salesforce Developers
Map keys and values can be of any data type—primitive types, collections, sObjects, user-defined types, ... Map keys of type String are case-sensitive....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
While, debugging my application, I found out another reason, why to implement this feature
Headers are currently of type
MutableMap
, while the behaviour ofMutableMap
is insufficient for the behavioural purposes of http headers.As it is mentioned in this issue
While headers can have more identical ‘keys’, I think http request parameters can not.
If I get time today, I will comment bellow more reasons to why to use
Map
/MutableMap
instead ofList<Pair>
. But I think @Fibonacci- stated a good point.Request.kt line 28