You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I try set basic qury string with value like curl_url_set(urlp, CURLUPART_QUERY, "a=hello world", CURLU_URLENCODE);
and then I try get URL like curl_url_set(urlp, CURLUPART_URL, &url, 0);
I expected the following
I expect url like http://example.com/?a=hello+world but I got http://example.com/?a%3dhello+world
I agree that adding multiple key / value pairs in one call can lead to ambiguity and function should add always only one pair per call. But function should not encode first equal sign.
Also, I found that curl does not encode equal sign when use call like curl_url_set(urlp, CURLUPART_QUERY, "a=hello=world", CURLU_APPENDQUERY + CURLU_URLENCODE);
In this case result is ?a=hello=world. It little inconsistence but not a bug I think.
curl/libcurl version
7.62.0 WinSSL+WinIDN
operating system
Windows 10 x64
The text was updated successfully, but these errors were encountered:
The documentation doesn't say anything about not encoding the equals sign when CURLU_URLENCODE is used. It does however say it for the CURLU_APPENDQUERY bit.
We could probably discuss if that shouldn't just skip the encoding of the first equals sign but at least what you describe matches the dopumentation!
I did this
I try set basic qury string with value like
curl_url_set(urlp, CURLUPART_QUERY, "a=hello world", CURLU_URLENCODE);
and then I try get URL like
curl_url_set(urlp, CURLUPART_URL, &url, 0);
I expected the following
I expect url like
http://example.com/?a=hello+world
but I gothttp://example.com/?a%3dhello+world
I agree that adding multiple key / value pairs in one call can lead to ambiguity and function should add always only one pair per call. But function should not encode first equal sign.
Also, I found that curl does not encode equal sign when use call like
curl_url_set(urlp, CURLUPART_QUERY, "a=hello=world", CURLU_APPENDQUERY + CURLU_URLENCODE);
In this case result is
?a=hello=world
. It little inconsistence but not a bug I think.curl/libcurl version
7.62.0 WinSSL+WinIDN
operating system
Windows 10 x64
The text was updated successfully, but these errors were encountered: