Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

$http buildUri function not converting arrays properly #7363

@mingos777

Description

@mingos777

I have a http GET request where I want to send an array:

$http({
    url: "/foo",
    method: "GET",
    params: {
        countries: [
            "US",
            "GB"
        ]
    }
});

I expect the built URL to be /foo?countries[]=US&countries[]=GB or, at the very least /foo?countries=["US","GB"] (this was the case of Angular.js 1.0.8).

However, the URL is actually /foo?countries=US&countries=GB - by all measures, this is an invalid query string.

The changes in $http's buildUrl function seem to have introduced the misbehaviour. It would be nice to see this fixed, as I need to do some really ugly patching to counter this.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions