Skip to content

arrays in query objects are not formatted #25

Open

Description

@shishircc

If query object has array, it will not be formatted
query = { a:{b:[1,2]},c:1}
will result in a=&c=1

Activity

  1. mauvm commented on Apr 21, 2017

    @mauvm

    I have the same problem.

    querystring@0.2.0 is used under the hood for formatting the query. See

    node-url/url.js

    Line 410 in 13a35bd

    query = querystring.stringify(this.query);
    .

    Unfortunately the querystring package does not stringify objects:
    https://github.com/Gozala/querystring/blob/master/encode.js#L24

    I was only using pathname and query, so qs (which supporst stringifying nested objects) will do for me.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions