afnetworking

How to convert AFNetworking service invoke to use AFHTTPSessionManager

☆樱花仙子☆ 提交于 2019-12-11 03:28:26
问题 This is my current call to (asmx) SOAP web service: NSString *soapMessage = [NSString stringWithFormat: @"<?xml version=\"1.0\" encoding=\"utf-8\"?>" "<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" "<soap:Body>" "<Save xmlns=\"http://www.myapp.com/\">" "<par1>%i</par1>" "<par2>%@</par2>" "<par3>%@</par3>" "</Save>" "</soap:Body>" "</soap:Envelope>", par1, par2,

JSON data messed up in AFNetworking POST request

我们两清 提交于 2019-12-11 03:27:46
问题 I am sending a request with AFNetworking for Objective-C. When I NSLog the parameters this is the object I am sending: games = ( { id = 50; p = 8; ts = 0; tt = (); tw = 0; ys = 35150; yt = { 156424496 = "37.416669"; 156609008 = "56.661210"; .... 252846816 = "7.075133"; 252856944 = "61.329850"; }; yw = 0; }, ... This is what the server receives. games = ( {id = 50;}, {p = 8;}, {ts = 0;}, {tw = 0;}, {ys = 35150;}, { yt = {156424496 = "37.416669";}; }, { yt = {156609008 = "56.661210";}; }, ... {

Restkit Authorization Header disappears

孤人 提交于 2019-12-11 03:27:13
问题 I already searched everywhere and this issue that should have been trivial is taking longer than I wanted therefore I am reaching you for help. I am using swift and integrated restkit using cocoapods. Despite, as you can see the screenshots/log, the header is fine however the outgoing http packet is not consistent. AppDelegate: RKlcl_configure_by_name("RestKit/Network", RKlcl_vTrace.value); RKlcl_configure_by_name("RestKit/ObjectMapping", RKlcl_vTrace.value); ObjectManagerCode: let

using 2 versions of AFNetworking in same ios project

旧街凉风 提交于 2019-12-11 03:23:44
问题 I have a project, where Ive used AFNetworking 2.0(not as cocoa pod - just added to project) Then, I've implemented calendar MSCollectionViewCalendarLayout, which has few dependencies packaged in a pod, one of which is // 'RestKit', '~> 0.22.0' //. RestKit uses AFNetowrking 1.3 and has it packaged within RestKit. While working with calendar, I have disabled my initial AFNetworking 2.0 code, but now when i fine tuned the calendar, Ive uncommented code for Login auth(AFNetworking 2.0), and it

Could not find an overload for 'println' that accepts the supplied arguments

帅比萌擦擦* 提交于 2019-12-11 03:14:44
问题 I'm porting my Objective-C code to Swift and got stuck with a weird error. I'm using a bridged version of https://github.com/AFNetworking/AFOAuth1Client if it helps. Can you please point me what's wrong? Thank you. A working Objective-C code: [oauthClient authorizeUsingOAuthWithRequestTokenPath:@"oauth_request.php" userAuthorizationPath:@"oauth_authorize.php" callbackURL:[NSURL URLWithString:@"oob"] accessTokenPath:@"oauth_access.php" accessMethod:@"POST" scope:nil success:^(AFOAuth1Token

Synchronous AFNetworking calls [closed]

徘徊边缘 提交于 2019-12-11 03:14:13
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 5 years ago . I am currently using AFNetworking in one of my iPhone app. It's really a handy library to make asynchronous calls. However, I ran into situations in my application where I need to get the data from the server to move forward. So I figured this way of waiting for the response

Memory warning while downloading file with AFNetworking

南楼画角 提交于 2019-12-11 02:39:54
问题 Update: I wrote a very simple download code: NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSURLRequest* request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:@"http://xxxx.s3.amazonaws.com/products/ipad/xxxx.mp4"]]; for(int i=0; i<4; i++){ NSString *filePath = [NSString stringWithFormat:@"%@/%@", documentsDirectory,[NSString stringWithFormat:@"xxxx%d.mp4",i]];

AFNetworking HTTP POST upload image stopping when near completion

倖福魔咒の 提交于 2019-12-11 02:14:16
问题 I am using the code below to HTTP POST a multi-part web form, including a JPEG image. Code: NSMutableDictionary *params = [[NSMutableDictionary alloc] init]; [params setObject:nameField.text forKey:@"name"]; [params setObject:emailField.text forKey:@"email"]; [params setObject:titleField.text forKey:@"title"]; [params setObject:dateString forKey:@"link"]; [params setObject:descriptionTV.text forKey:@"content"]; [params setObject:tag forKey:@"tags"]; NSData* sendData =

Uploading video using AFNetworking causes memory issue

白昼怎懂夜的黑 提交于 2019-12-11 01:49:22
问题 I know this question has been asked before but I can't figure out the correct way from those posts. So here is my code to upload a video file that causes memory issues: AFHTTPSessionManager *operationManager = [AFHTTPSessionManager manager]; operationManager.responseSerializer=[AFJSONResponseSerializer serializer]; operationManager.responseSerializer.acceptableContentTypes = [NSSet setWithObject:@"text/html"]; //[operationManager.requestSerializer setValue:@"application/json"

Example on using AFNetworking to post XML?

不羁的心 提交于 2019-12-11 01:19:02
问题 As a followup to this question, I cannot get this to work so I need to take a step back I think. Can someone post some sample code on how to post XML to a rest service WITHOUT using params? Is it even possible? Basically I have an object with several properties, and I convert this to XML and then need to upload it. But it fails if there is an image converted to string in the XML. Without that it works fine. Even a JSON example would be helpful... Totally blocked here :P 回答1: Use