afnetworking

Timed Out while using AFHTTPSessionOperation

守給你的承諾、 提交于 2019-12-11 08:26:40
问题 Can anybody tell me why my call "timed out"? My app just hangs there, the success:^(NSURLSessionTask* operation, id response) section of the folowing code was never executed. return [self beginRequestController:@"myController" action:@"myAction" parameters:parameters success:^(NSURLSessionTask* operation, id response) { NSLog(@"This is NOT being called --->>>: %@", response); } failure:^(NSURLSessionTask* operation, NSError* error) { //Handle the error }]; - (NSOperation*)

Not able to store credit card in Paypal using “v1/vault/credit-cards”

本小妞迷上赌 提交于 2019-12-11 08:03:58
问题 I am using Paypal vault for one of my application. I need to stored Credit Card into vault. I used the paypal vault api ( v1/vault/credit-cards ) for it. But It always returns 500. I also tried with actual Credit card, but didn't get positive reponse. I am able to get access token and also get success response in listing service. But not able to stored card. Below is my code: Request Para: NSMutableDictionary *dicCC = [[NSMutableDictionary alloc]init]; dicCC[@"payer_id"] = @"123345"; dicCC[@

Implement custom cache for AFNetworking 3.x

醉酒当歌 提交于 2019-12-11 07:34:30
问题 Hi I'm writing a IOS api to fetch data from server using AFNetworking 3.x My Server does not support caching. This this server header Connection →Keep-Alive Content-Length →4603 Content-Type →text/html; charset=UTF-8 Date →Wed, 10 Aug 2016 04:03:56 GMT Keep-Alive →timeout=5, max=100 Server →Apache/2.4.18 (Unix) OpenSSL/1.0.1e-fips PHP/5.4.45 X-Powered-By →PHP/5.4.45 I want to build custom API to enable cache (for example request and response should be cache for 10 second so that if user make

Load Images One At A Time

我与影子孤独终老i 提交于 2019-12-11 06:32:37
问题 So this code basically gets data from a server, creates an image, and then adds it to the view. However, I would like it to update the view one at a time. Right now, the view is updated with all the images at once after all are loaded. I would like to update the view, everytime a new image is uploaded - This should happen in the addImage method, but instead, it is just waiting for all the images to load. I tried using a dispatch_async to solve this problem, but it did not work. So how do I

AFNetworking QUEUE with pdf, png, mp4 files

依然范特西╮ 提交于 2019-12-11 05:42:07
问题 I have a server and i get that response : {"products": [ { "product_id": "1170", "name": "zzzz®", "sort_order": 0, "brand": "zzzas", "product_category_id": "1090", "location_ids": [ "1078" ], "icon_url": "http://zzzzz.com/media/2502/zzzz.png", "icon_date": "Wed, 07 Nov 2012 14:03:47 GMT", "thumbnail_url": "http://zzzz.com/media/2591/zzdfs.png", "thumbnail_date": "Wed, 07 Nov 2012 14:04:02 GMT" }, { "product_id": "1126", "name": "ddddd®", "sort_order": 1, "brand": "dddsas", "product_category

iOS - Download Video

╄→尐↘猪︶ㄣ 提交于 2019-12-11 04:36:31
问题 I'd like to download a video from a remote URL and save it to a file in an iPhone app. I know the video link works, since I have used it from AVPlayer, however, I am unable to download it. The response is always (null). What is wrong with the following code? NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:someURLString]]; AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request]; operation.outputStream = [NSOutputStream

Cannot make singleton for JSON and XML response using AFNetworking 3

早过忘川 提交于 2019-12-11 04:35:48
问题 Hi I'm Making a singleton for networking for JSON and XML response my ApiClient.h + (ApiClient *)sharedInstance; -(instancetype)initWithBaseURL:(NSURL *)url sessionConfiguration:(NSURLSessionConfiguration *)configuration; My ApiClient.m + (ApiClient *)sharedInstance { static ApiClient *sharedInstance = nil; static dispatch_once_t oncePredicate; dispatch_once(&oncePredicate, ^{ NSURLSessionConfiguration *sessionConfiguration = [NSURLSessionConfiguration defaultSessionConfiguration];

queue of AFNetworking requests with dispatch_group_t

谁都会走 提交于 2019-12-11 04:25:53
问题 I want to send messages one by one in a queue. In other words I need to send new request after I get the response of the previous request. I use dispatch_group_t with AFNetworking But it does not work as I expected (I know there are other ways with operationQueue ). Here is my controller: - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; dispatch_async(queue, ^{ [self sentTest]; }); } - (void) sentTest{ dispatch_group_t group = dispatch_group_create(); NSLog(@"Start ...

AFNetworking - Making an XML POST request to REST service? How to form NSDictionary parameters?

百般思念 提交于 2019-12-11 03:52:23
问题 I am trying to create a POST request to a REST API to post a new time entry. The required XML structure for the post request is as follows: <time-entry> <person-id>#{person-id}</person-id> <date>#{date}</date> <hours>#{hours}</hours> <description>#{description}</description> </time-entry> With AFNetworking is the XML encoding done behind the scenes just from passing an NSDictionary of parameters to the POST request? Here is my code so far: From my APIClient: -(void)postTimeEntry:(TLActiveWork

AFNetworking + JSON + progress download

白昼怎懂夜的黑 提交于 2019-12-11 03:32:33
问题 I'm using AFNetworking and like it very much. I need to get JSON data from my server and it's OK, it works perfectly. I added the setDownloadProgressBlock but I think it can't work with JSON download: maybe it's not possible to get the estimated amount of bytes to download. My code: NSMutableURLRequest *request = [[VinocelaHTTPClient sharedClient] requestWithMethod:@"GET" path:@"ws/webapp/services/pull" parameters:nil]; AFJSONRequestOperation *operation = [AFJSONRequestOperation