Skip to content

Unirest does not preserve query string in Url #130

@thehappybug

Description

@thehappybug

I ran into an issue where I needed to send arrays in query strings but encoded in a different style than is common in PHP. Example: first=value&arr=foo+bar&arr=baz.

However, since Unirest is rebuilding the Url before sending the request, the query string is rewritten and only one of the values of the array "arr" is kept.

I am attaching the line which seems to be the cause of this issue.

$query = '?' . http_build_query(self::getArrayFromQuerystring($query));

Is there a workaround or a fix for this?

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