Skip to content

Support params as list for exploding parameters #12410

@lmazuel

Description

@lmazuel

When doing a call like this:

request = self._client.get(url, query_parameters, header_parameters)

We are coming here:

def format_parameters(self, params):
# type: (Dict[str, str]) -> None
"""Format parameters into a valid query string.
It's assumed all parameters have already been quoted as
valid URL strings.
:param dict params: A dictionary of parameters.
"""
query = urlparse(self.url).query
if query:
self.url = self.url.partition("?")[0]
existing_params = {
p[0]: p[-1] for p in [p.partition("=") for p in query.split("&")]
}
params.update(existing_params)
query_params = ["{}={}".format(k, v) for k, v in params.items()]
query = "?" + "&".join(query_params)
self.url = self.url + query

We should accept a list of string as params for instance {'a':['b','c']}, and explode the parameters in that case: a=b&a=c

FYI @johanste

Metadata

Metadata

Labels

Azure.CoreClientThis issue points to a problem in the data-plane of the library.feature-requestThis issue requires a new behavior in the product in order be resolved.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions