Currently the definition of post & put methond in ACurl is different from the get, delete & head. I consider that this function should have consistent signatures. Get, delete, and head are missing the $data.
If the $data was added, to have consistent signature, it is expected that the data params will be appended to the url provided but does this need more special handling than http_build_query($data)?
Example:
<?php
$c=new ACurl();
$c->get('http://api.someservice.com',array('user'=>1),true);
var_dump($c->options->url);
Is this result to http://api.someservice.com/user/1 or http://api.someservice.com?user=1 ? Thing is that if we want the ACurl to handle the above url construction it need to have a $urlFormat property to accept 2 consts 'path' or 'get', similar to the CUrlManager
Bad think is that even the CUrlManager has the functionality for creating path or get urls id does not provide a method for out of the application urls and even if he did it would be useless as the url format of your yii application may differ from the url format you want to fetch data from.
On the other hand url format seems to be an irrelevant property for a curl object to some people. Please let me know what do you think about it.
Currently the definition of post & put methond in
ACurlis different from the get, delete & head. I consider that this function should have consistent signatures. Get, delete, and head are missing the$data.If the
$datawas added, to have consistent signature, it is expected that the data params will be appended to the url provided but does this need more special handling thanhttp_build_query($data)?Example:
Is this result to
http://api.someservice.com/user/1orhttp://api.someservice.com?user=1? Thing is that if we want theACurlto handle the above url construction it need to have a$urlFormatproperty to accept 2 consts 'path' or 'get', similar to theCUrlManagerBad think is that even the
CUrlManagerhas the functionality for creating path or get urls id does not provide a method for out of the application urls and even if he did it would be useless as the url format of your yii application may differ from the url format you want to fetch data from.On the other hand url format seems to be an irrelevant property for a curl object to some people. Please let me know what do you think about it.