Kong / unirest-php

Unirest in PHP: Simplified, lightweight HTTP client library.
http://unirest.io/php
MIT License
1.28k stars 328 forks source link

Unirest does not preserve query string in Url #130

Open thehappybug opened 6 years ago

thehappybug commented 6 years ago

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.

https://github.com/Kong/unirest-php/blob/14aa9aa6919e4b70c59cd20722ac113c0ffeb45b/src/Unirest/Request.php#L555

Is there a workaround or a fix for this?

ad-git commented 6 years ago

My old pull request solve this issue and other, see: https://github.com/Kong/unirest-php/pull/114

prasad83 commented 6 years ago

I got hit with this bug and submitted working fix #133