billycheuk / weibosdk

Automatically exported from code.google.com/p/weibosdk
0 stars 0 forks source link

Reduce logic of proxy determining in MicroBlog.as #1

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
if(_useProxy) executeRequest(uri, getMicroBlogRequest(PROXY_URL, params, 
URLRequestMethod.POST));
else executeRequest(uri, getMicroBlogRequest(API_BASE_URL + uri, params, 
URLRequestMethod.POST));

//  to below

public function get apiURL ():String
{
    return this._useProxy:Boolean ? PROXY_URL : API_BASE_URL;
}

executeRequest(uri, getMicroBlogRequest(apiURL + uri, params, 
URLRequestMethod.POST));

Original issue reported on code.google.com by himcot...@gmail.com on 18 Apr 2011 at 3:21

GoogleCodeExporter commented 8 years ago
oops, should be like this:

public function get apiURL ():String
{
    return this._useProxy:Boolean ? PROXY_URL : API_BASE_URL + uri;
}

executeRequest(uri, getMicroBlogRequest(apiURL, params, URLRequestMethod.POST));

Original comment by himcot...@gmail.com on 18 Apr 2011 at 3:24