I do a lot of posting via PHP CURL. Generally, we post to servers that are expecting straight HTTP POST or JSON. So, we build the parameters as an array... and then json_encode the array or http_build_query the array... and post the result in CURLOPT_POSTFIELDS. Someone programmed some web pages for us... and they posted the form data via a secondary page by posting the array $_POST to our server... and it worked! Sure, enough I looked up the specs for CURLOPT_POSTFIELDS... and it can take a string or an array. So, I am confused... why does it seem the protocol is to convert the array to a string with http_build_query, when one can simply post the array (at least if it is one-dimensional)? Is this only because of URL encoding side-benefit of http_build_query.... or is there another reason?
P.S. When the array contained a parameter that was a complete URL, i.e. with query, such as http://example.com?a=1&b=2&c=3 the server read the data fine, even though the parameter was not URL encoded... or does posting an array automatically urlencode the elements of the array?