question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Parameters should be Map<String, Any?>

See original GitHub issue

In 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:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:7

github_iconTop GitHub Comments

1reaction
monareziocommented, Jul 19, 2018

While, debugging my application, I found out another reason, why to implement this feature

Headers are currently of type MutableMap, while the behaviour of MutableMap is insufficient for the behavioural purposes of http headers.

Multiple headers with the same name is allowed in the HTTP spec, section 4.2

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 of List<Pair>. But I think @Fibonacci- stated a good point.

0reactions
markGilchristcommented, Jul 19, 2018

Request.kt line 28

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found