API呼び出しを行うときにRestKitがパスを削除するのはなぜですか?それは電話までそれが良いことを示しています。
これが私がそれを登録する方法です
AFHTTPClient *client = [[AFHTTPClient alloc] initWithBaseURL:[NSURL URLWithString:[[NSUserDefaults standardUserDefaults] objectForKey:@"apiURL"]]];
[client setDefaultHeader:@"Accept" value:RKMIMETypeJSON];
[client setParameterEncoding:AFJSONParameterEncoding];
RKObjectManager *objectManager = [[RKObjectManager alloc] initWithHTTPClient:client];
NSLog(@"Created client: %@", objectManager.HTTPClient);
これは私が他のクラスでそれを呼ぶ方法です
RKObjectManager *manager = [RKObjectManager sharedManager];
NSLog(@"HTTP Client: %@", manager.HTTPClient);
共有objectManagerを呼び出す他のクラスでも正しいのですが、呼び出し中にログが記録され、/api/v1
が取り出されるために応答が悪くなります。
NSLOG
2013-03-13 13:24:08.960 Project[54631:403] HTTP Client: <AFHTTPClient: 0x1033d6230, baseURL: https://my.server.com/api/v1/, defaultHeaders: {
Accept = "application/json";
"Accept-Language" = "en, ja, fr, de, es, it, pt, pt-PT, nl, sv, nb, da, fi, ru, pl, zh-Hans, zh-Hant, ko, ar, cs, hu, tr, en-us;q=0.8";
Authorization = "Bearer <My Access Token>";
"User-Agent" = "Project/1.0 (Mac OS X Version 10.7.5 (Build 11G63))";
}, registeredOperationClasses: (
), operationQueue: <NSOperationQueue: 0x1033db8c0>{name = 'NSOperationQueue 0x1033db8c0'}>
2013-03-13 13:24:08.960 Project[54631:403] Manager: <RKObjectManager: 0x1033db940>
2013-03-13 13:24:08.971 Project[54631:403] I restkit.network:RKHTTPRequestOperation.m:154 GET 'https://my.server.com/features/1234?with_lock=false'
2013-03-13 13:24:09.310 Project[54631:403] I restkit.network:RKHTTPRequestOperation.m:185 GET 'https://my.server.com/features/1234?with_lock=false' (200 OK)