草庐IT

mpi_request

全部标签

ios - 使用 AFNetworking 如何读取 request.responseString 中包含的错误消息

NSLog(@"%@",request.responseString);这给了我{"errors":{"email":["isalreadytaken"]}}的输出。我想将电子邮件和消息字符串"isalreadytaken"保存到一个字符串中以显示在警报中。如何将这两项访问到两个字符串中? 最佳答案 响应字符串是服务器的原始输出。在这种情况下,它是JSON编码的。您可以使用AFNetworkingJSON特定类之一(即AFJSONRequestOperation)将响应作为JSON对象返回,或者使用NSJSONSerializati

ios - Azure AD B2C 获取 oauthConnection 错误 : Bad Request

在尝试集成AzureADB2C时,我遇到了错误“oauthConnection错误:错误请求”。按照他们给定的样本app一切正常。但是在从工作示例应用程序中集成相同的复制粘贴代码并尝试使用Facebook或GooglePlus登录后,它会抛出错误!我非常确定我在示例应用程序中使用的每个凭据对于我的应用程序都是相同的。对此有任何想法将不胜感激。这是我的代码,AppDelegate.m#import"AppData.h"#import"NXOAuth2.h"#import"AppDelegate.h"@interfaceAppDelegate()@end@implementationApp

ios - NSURLProtocol canInitWithRequest : only works for certain requests

我有一个WebView,我想拦截和修改来自各个站点的某些请求。我正在对每个截获的请求进行完全相同的修改,无论它来自哪个站点。它似乎无缘无故地适用于除一个站点之外的每个站点。这是我的代码:在我的ResourceLoadDelegate中-(NSURLRequest*)webView:(WebView*)senderresource:(id)identifierwillSendRequest:(NSURLRequest*)requestredirectResponse:(NSURLResponse*)redirectResponsefromDataSource:(WebDataSource

ios - 无法加载网页,错误为 : The requested URL was not found on this server

我的PhoneGap应用程序遇到一个奇怪的错误:每次我运行模拟器(或我手机上测试部署的应用程序)时,我都会收到错误Failedtoloadwebpagewitherror:TherequestedURLwasnotfoundonthisserver.每次我运行模拟器时它都能正常工作。自从我第一次部署我的应用程序以来,这种情况一直在发生。当时我没有使用任何插件,但从那以后我一直在尝试让FacebookiOSSDK工作,这可能不相关但是我的应用程序实际成功启动的时间,我无法点击任何东西。上帝帮助我。这是我第一次构建iOS应用程序,所以这可能是新手犯的错误-在此之前我的应用程序只是一个移动网

iphone - Restkit Objective-C : Post request only works once

我正在使用Restkit与DrupalCMS进行通信。当我发送首先请求一切正常:我得到正确的JSON-字符串->太棒了。控制台是这样说的:2011-06-2423:00:48.344MyApp[1399:207]SendingPOSTrequesttoURLhttp://mysite.com/myproject/services/rest/service_views/get.json.HTTPBody:view_name=viewsname如果应用程序尝试再次发送相同的请求,则不会发生任何事情。没有任何委托(delegate)方法被调用。控制台说:2011-06-2423:03:40.

iphone - 从 google places API 获取数据后获取状态 "REQUEST_DENIED"

我做到了NSURLRequest*request=[NSURLRequestrequestWithURL:[NSURLURLWithString:@"https://maps.googleapis.com/maps/api/place/search/json?location=30.722322,76.76126&radius=500&types=food&sensor=true&key=any_apiKey"]];NSURLResponse*response;NSError*error;NSData*responseData=[NSURLConnectionsendSynchrono

ios - 在 NativeScript 中执行 XHR-Request 时出现 UICollectionViewFlowLayout 异常

我试图通过Xcode7对给定的API执行POST请求。我的错误是:thebehavioroftheUICollectionViewFlowLayoutisnotdefinedbecause:theitemheightmustbelessthantheheightoftheUICollectionViewminusthesectioninsetstopandbottomvalues,minusthecontentinsetstopandbottomvalues.TherelevantUICollectionViewFlowLayoutinstanceis,anditisattachedt

ios - AF 网络 2.0 : is it possible to put pure json in the body of a POST request?

我想从我的应用程序发出以下请求:AFHTTPRequestOperationManager*requestManager=[[AFHTTPRequestOperationManageralloc]init];requestManager.responseSerializer.acceptableContentTypes=[requestManager.responseSerializer.acceptableContentTypessetByAddingObject:@"application/json"];requestManager.requestSerializer=[AFJSO

ios - 错误域=com.alamofire.error.serialization.response 代码=-1011“请求失败 : bad request (400)

我正在使用AFnetworking库在服务器上发布数据。以下是我在服务器上发布数据的代码。-(void)callLoginAPI:(NSDictionary*)dictProfile{//1NSDictionary*params=[NSDictionarydictionaryWithObjectsAndKeys:[dictProfilevalueForKey:@"name"],@"username",[dictProfilevalueForKey:@"first_name"],@"first_name",[dictProfilevalueForKey:@"last_name"],@"l

ios - TestFlight 错误 "Your request couldn' t 完成”?

我正在使用TestFlight测试iOS应用程序。我已经成功测试了8Build预发布版,但现在它不再工作了。我已经上传了构建的并且它已经得到Apple的批准,已经发送并正确接收了对外部测试人员的邀请,但是当他们打开TestFlight并尝试下载应用程序时,下载就在结束前停止,并且alertView说:Yourrequestcouldn'tbecompleted注意事项:我试过在不同的设备上下载,但都没有用。如果没有完成下载,TestFlight也会增加安装计数。我今天早上上传了构建的。 最佳答案 找到解决方案。最新的XCode版本将