modxcms/revolution — pull request #11279 by exside (2014-04-14 12:37:48+00:00)
Title: Enhance modRestCurlClient with query string for postfields

Added possibility for the native REST cURL client to send postfields as query string for APIs (like Google Closure Compiler) that cannot handle a normal passed params array. Now when the contentType in the options array is set to string, the params/postfields array is transformed to param1=value¶m2=http://www.url.tld/¶m3=somethingelse. The array_map() stuff has to be done because http_build_query is not suitable here as it encodes special characters like slashes in a url etc., which are then also not understood by such APIs...so it has unfortunately to be done like that:

```
$this->modx->getService('getfile','rest.modRestCurlClient');
$params = array(
'param1' => 'value',
'param2' => 'http://www.url.tld/',
'param3' => 'somethingelse'
);
$options = array('contentType' => 'string');
$response = $this->modx->getfile->request($url, $path, $method, $params, $options);
```