草庐IT

register_post_meta

全部标签

ios - NSURLProtocol 和 post 上传进度

我正在使用NSURLProtocol的子类来拦截所有HTTP调用并修改用户代理以及添加我的服务器所需的其他httpheader。-(id)initWithRequest:(NSURLRequest*)requestcachedResponse:(NSCachedURLResponse*)cachedResponseclient:(id)client{NSMutableURLRequest*lInnerRequest;//************************************************lInnerRequest=[requestmutableCopy];[

ios - POST header 和正文之间的随机延迟

我们使用NSUrlConnectionsendAsynchronousRequest向我们的NodeJS服务器发送简单的POST请求。通过分析tcpdump,我们注意到有时请求header和请求正文被拆分为2个独立的TCP数据包。NSMutableURLRequest*request=[[NSMutableURLRequestalloc]init];[requestsetURL:[NSURLURLWithString:url]];[requestsetTimeoutInterval:3];[requestsetHTTPMethod:@"POST"];[requestsetValue:p

iphone - 如何获取 cookie 并将它们用于其他请求,如 POST ( iOS )?

我的previousquestion是关于我每次都必须登录才能进行网络服务(例如发布链接或上传图片)的问题。Philipe回答说我必须为每个请求使用cookie而不是登录过程。我找到了这种获取cookie的方法:-(void)getCookies{NSHTTPURLResponse*response;NSError*error;NSMutableURLRequest*request;request=[[NSMutableURLRequestalloc]initWithURL:[NSURLURLWithString:@"http://MyWebsite.com/login.php"]ca

ios - Apple Smart Banner (meta apple-itunes-app) 无法使用我的应用程序 ID - 在 iPhone Safari 上清除缓存后也无法使用

AppleSmartBanner(metaapple-itunes-app)无法使用我的应用程序ID-在iPhoneSafari上清除缓存后也无法使用。我正在使用这个:如果我将应用ID替换为其他任何人,它会起作用。它曾经在一段时间之前工作过,但我不确定发生了什么变化。也许与iOS7有关? 最佳答案 在iOS7中有一个错误会阻止横幅重新出现。这相当激烈,但是执行设置->常规->重置->重置所有设置似乎可以让它重新出现。 关于ios-AppleSmartBanner(metaapple-it

iphone - 如何使用 ASIFormDataRequest 到 NSDictionary 对象的 http post 数组

嘿,我需要使用一组NSDictionary对象发出HTTPPOST请求。但是,当我这样做时,我注意到在服务器端NSDictionary对象没有反序列化为散列。它被反序列化为一个字符串——这不是我想要的。这是我从客户端(iPhone)端发送参数的方式:ASIFormDataRequest*request=[ASIFormDataRequestrequestWithURL:url];for(ABContact*cincontactsWithEmailsOrPhones){NSString*phoneNumber=[[ABContactsHelperclass]contactPhoneNum

iOS 7 SLComposeViewController : Check if tweet was actually posted?

我目前正在使用SLComposeViewController将用户的分数发布到Twitter或Facebook(取决于他们点击的按钮)。当他们分享时,他们将获得虚拟货币奖励。我面临的问题是它只会告诉我用户是点击发送还是取消。我如何检查推文是否实际发布到推特上?这将有助于解决用户尝试两次提交同一条推文的情况(推特不允许)。这是我现在的代码://Checkifusercansendtweetif([SLComposeViewControllerisAvailableForServiceType:SLServiceTypeTwitter]){SLComposeViewController*t

ios - "More than maximum 5 filtered albums trying to register. This will fail."使用 Assets 库

我有时会收到“超过最多5个筛选相册试图注册。这将失败。”当我在ALAssetsGroup上调用setAssetsFilter时。谁知道为什么?我见过类似的问题,但都与UIImagePickerController相关。这里是代码:ALAssetsLibrary*lib=[[ALAssetsLibraryalloc]init];[libenumerateGroupsWithTypes:ALAssetsGroupSavedPhotosusingBlock:^(ALAssetsGroup*group,BOOL*stop){[groupsetAssetsFilter:[ALAssetsFilt

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 - AFNetworking 在 post 请求的 JSON 参数中发送数组

我正在尝试通过POST将参数发送到我的服务器,它通常可以正常工作,但我不知道如何发送包含数组作为参数之一的JSON。这是我尝试过的:AFHTTPClient*httpClient=[[AFHTTPClientalloc]initWithBaseURL:[NSURLURLWithString:myURL]];NSMutableArray*objectsInCart=[NSMutableArrayarrayWithCapacity:[_cartcount]];for(NSDictionary*dictin_cart){NSObject*object=[dictobjectForKey:@"

php - AFNetworking 2.0 POST 问题,Cocoa 错误 3840(JSON 文本没有以数组开头...)

我正在尝试在我的本地服务器上调用api.php(使用MAMP)。服务器端api.php被调用,但是php代码中_POST的内容有如下错误:ErrorDomain=NSCocoaErrorDomainCode=3840"Theoperationcouldn’tbecompleted.(Cocoaerror3840.)"(JSONtextdidnotstartwitharrayorobjectandoptiontoallowfragmentsnotset.)UserInfo=0x15d7bdd0{NSDebugDescription=JSONtextdidnotstartwitharray