Tag: box api

405方法不允许

我试图访问https://api.box.com/2.0/files但我收到Expected status code in (200-299), got 405在我的答复(来自AFNetworking) Expected status code in (200-299), got 405 。 在发送请求之前,我从服务器上获取auth_token。 码 – (void)getFileListing:(NSString*)apiKey { if(apiKey == nil) { apiKey = kBoxNetApiKey; } NSDictionary *boxAuth = [[NSUserDefaults standardUserDefaults] objectForKey:kBoxNetUserDefaultsKey]; if([boxAuth objectForKey:@"auth_token"] != nil) { NSURL *url = [NSURL URLWithString:@"https://api.box.com/2.0/files"]; NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url]; [request setHTTPMethod:@"GET"]; DLog(@"auth_token: %@", [boxAuth objectForKey:@"auth_token"]); […]

为什么在尝试loginBox时遇到redirectURI不匹配?

当使用iOS的Box SDK执行OAuth时,我显示一个网页,显示此错误: 错误:redirect_uri_mismatch response_type = code redirect_uri = boxsdk-our4iypzazstfpx8j70e8tlc3eyn9c4l:// boxsdkoauth2redirect state = ok client_id = our4izzstfpx8j70e8tlc3eyn9c4l 我用他们build议的代码: [self presentViewController:[[BoxAuthorizationViewController alloc] initWithAuthorizationURL:[[BoxSDK sharedSDK].OAuth2Session authorizeURL] redirectURI:nil ] animated:YES completion:nil ]; 我的客户端ID和客户端密码在此之前设置。 在我的info.plist文件中,我有boxsdk-our4iypzazstfpx8j70e8tlc3eyn9c4l作为URLscheme。 我无法遵循的唯一指示是: 注意:在Box上设置服务时,请将OAuth2redirectURI留空。 发出OAuth2调用时,SDK将提供自定义redirectURI; 这样做需要在您的服务设置中不设置redirectURI。 当我试图离开redirect的URI空白,并保存在开发者控制台的forms,我得到这个错误: OAuth2redirecturl必须指定有效的url,且不得为http:// 所以我被迫input了一些东西。 我input“ https://mydomain.com ”(与我的真实域)。 我修改了iOS代码以将该URI传递给BoxAuthorizationViewController,但是我仍然得到相同的错误网页。