Skip to content

cy.request parameter qs does not work for multiple keys of the same name #17921

Open
@Lasidar

Description

Current behavior

When calling cy.request with the qs option, if multiple keys of the same name are utilized in the query, cypress only uses one of them in the resulting URI.

Desired behavior

Cypress should take all query key/value pairs, regardless of if any keys are duplicated, since this is valid in a URI.

Test code to reproduce

        cy.request({
          method: "POST",
          url: "www.google.com/api",
          qs: {
              "someKey": "value1",
              "someKey": "value2",
          }})

This should result in a POST to www.google.com/api?someKey=value1&someKey=value2, but instead results in a POST to http://www.google.com/api?someKey=value2

Cypress Version

8.2.0

Other

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    TriagedIssue has been routed to backlog. This is not a commitment to have it prioritized by the team.type: unexpected behaviorUser expected result, but got another

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions