ZF-11797: zend_rest_client doesnt easily allow params with underscores
Description
zend_rest_client doesnt easily allow params with underscores so that web service apis that use a "_" in parameter names are harder to call
[code] <?php
require 'secret.php';
set_include_path(get_include_path() . PATH_SEPARATOR . $myincpath);
require_once 'Zend/Loader/Autoloader.php';
Zend_Loader_Autoloader::getInstance();
$url="https://$mysandbox.parature.com"; $path = "/api/v1/$key1/$key2/Customer";
// FAILS // $client = new Zend_Rest_Client($url.$path); // V1 // $result = $client->token($token); // V2 // $result = $client->token($token); // $result = $client->get();
// WORKAROUND $client = new Zend_Rest_Client($url.$path); $result = $client->restGet("/api/v1/$key1/$key2/Customer", array('token'=>$token));
var_dump($result); [/code]
V1 ERROR [code] ["code"]=> string(3) "400" ["description"]=> string(10) "BadRequest" ["message"]=> string(35) "The URI is not valid: Missing token" [/code]
V2 ERROR [code] ["code"]=> string(3) "400" ["description"]=> string(11) "Bad Request" ["message"]=> string(131) "One or more fields are invalid; Unused Field Name (ID): method (); Unused Field Name (ID): arg1 (); Unused Field Name (ID): rest ()" [/code]
Comments
No comments to display