@@ -214,11 +214,22 @@ - (NSMutableURLRequest *)requestWithPath:(NSString *)path
214214 method : (NSString *)method
215215 headers : (NSDictionary *)headers
216216 parameters : (id )parameters
217+ {
218+ return [self requestWithPath: path method: method headers: headers parameters: parameters paddingVersion: true ];
219+ }
220+
221+ - (NSMutableURLRequest *)requestWithPath : (NSString *)path
222+ method : (NSString *)method
223+ headers : (NSDictionary *)headers
224+ parameters : (id )parameters
225+ paddingVersion : (BOOL )paddingVersion
217226{
218227 NSURL *URL = [NSURL URLWithString: path];
219228
220229 if (!URL.scheme .length ) {
221- NSString *URLString = [[LCRouter sharedInstance ] appURLForPath: path appID: [LCApplication getApplicationId ]];
230+ NSString *URLString = [[LCRouter sharedInstance ] appURLForPath: path
231+ appID: [LCApplication getApplicationId ]
232+ paddingVersion: paddingVersion];
222233 URL = [NSURL URLWithString: URLString];
223234 }
224235
@@ -258,21 +269,72 @@ - (NSMutableURLRequest *)requestWithPath:(NSString *)path
258269 return request;
259270}
260271
261- - (void )getObject : (NSString *)path withParameters : (NSDictionary *)parameters block : (LCIdResultBlock)block {
262- [self getObject: path withParameters: parameters block: block wait: false ];
272+ - (void )getObject : (NSString *)path
273+ withParameters : (NSDictionary *)parameters
274+ block : (LCIdResultBlock)block {
275+ [self getObject: path
276+ paddingVersion: true
277+ withParameters: parameters
278+ block: block];
279+ }
280+
281+ - (void )getObject : (NSString *)path
282+ paddingVersion : (BOOL )paddingVersion
283+ withParameters : (NSDictionary *)parameters
284+ block : (LCIdResultBlock)block {
285+ [self getObject: path
286+ paddingVersion: paddingVersion
287+ withParameters: parameters
288+ block: block
289+ wait: false ];
263290}
264291
265- - (void )getObject : (NSString *)path withParameters : (NSDictionary *)parameters block : (LCIdResultBlock)block wait : (BOOL )wait {
266- [self getObjectFromNetworkWithPath: path withParameters: parameters policy: kLCCachePolicyIgnoreCache block: block wait: wait];
292+ - (void )getObject : (NSString *)path
293+ withParameters : (NSDictionary *)parameters
294+ block : (LCIdResultBlock)block
295+ wait : (BOOL )wait {
296+ [self getObjectFromNetworkWithPath: path
297+ withParameters: parameters
298+ policy: kLCCachePolicyIgnoreCache
299+ block: block
300+ wait: wait];
301+ }
302+
303+ - (void )getObject : (NSString *)path
304+ paddingVersion : (BOOL )paddingVersion
305+ withParameters : (NSDictionary *)parameters
306+ block : (LCIdResultBlock)block
307+ wait : (BOOL )wait {
308+ [self getObjectFromNetworkWithPath: path
309+ paddingVersion: paddingVersion
310+ withParameters: parameters
311+ policy: kLCCachePolicyIgnoreCache
312+ block: block
313+ wait: wait];
314+ }
315+
316+ - (void )getObjectFromNetworkWithPath : (NSString *)path
317+ withParameters : (NSDictionary *)parameters
318+ policy : (LCCachePolicy)policy
319+ block : (LCIdResultBlock)block
320+ wait : (BOOL )wait
321+ {
322+ [self getObjectFromNetworkWithPath: path
323+ paddingVersion: true
324+ withParameters: parameters
325+ policy: policy
326+ block: block
327+ wait: wait];
267328}
268329
269330- (void )getObjectFromNetworkWithPath : (NSString *)path
331+ paddingVersion : (BOOL )paddingVersion
270332 withParameters : (NSDictionary *)parameters
271333 policy : (LCCachePolicy)policy
272334 block : (LCIdResultBlock)block
273335 wait : (BOOL )wait
274336{
275- NSURLRequest *request = [self requestWithPath: path method: @" GET" headers: nil parameters: parameters];
337+ NSURLRequest *request = [self requestWithPath: path method: @" GET" headers: nil parameters: parameters paddingVersion: paddingVersion ];
276338
277339 if (parameters && request.URL .absoluteString .length > 4096 ) {
278340 /* If GET request too heavy, wrap it into a POST request and ignore cache policy. */
0 commit comments