afnetworking-2

How to use AFNetworking 2 with Digest Authentication

旧巷老猫 提交于 2021-02-07 14:40:56
问题 I've been searching for "AFNetworking 2 with Digest Authentication" for a while and haven't found useful discussions about it (except this one, but unfortunately it looks like it's for AFNetworking 1). Here's my code without authentication: NSString* apiURL = @"https://api.example.com/WS.asmx"; AFHTTPSessionManager* manager = [AFHTTPSessionManager manager]; manager.requestSerializer = [AFJSONRequestSerializer serializer]; [manager GET:apiURL parameters: [NSDictionary

How to use AFNetworking 2 with Digest Authentication

北城余情 提交于 2021-02-07 14:40:41
问题 I've been searching for "AFNetworking 2 with Digest Authentication" for a while and haven't found useful discussions about it (except this one, but unfortunately it looks like it's for AFNetworking 1). Here's my code without authentication: NSString* apiURL = @"https://api.example.com/WS.asmx"; AFHTTPSessionManager* manager = [AFHTTPSessionManager manager]; manager.requestSerializer = [AFJSONRequestSerializer serializer]; [manager GET:apiURL parameters: [NSDictionary

AFNetworking 2.0 Send Post Request with array of dictionary Parameters

倾然丶 夕夏残阳落幕 提交于 2020-02-06 06:52:28
问题 I want to try post parameter in the following API but the parameter is not getting passed properly, and the response received gives the message that, data is required. So can anyone please help to sort out this problem. my url is forapp.com/api/getContacts.php?data=[ {"name":"abc","phone":"1234567890"},{"name":"Kate Bell","phone":"9925992599"} ] so how i can pass this type of request to the api AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager]; NSDictionary

AFNetworking 2.0 Send Post Request with array of dictionary Parameters

浪子不回头ぞ 提交于 2020-02-06 06:52:11
问题 I want to try post parameter in the following API but the parameter is not getting passed properly, and the response received gives the message that, data is required. So can anyone please help to sort out this problem. my url is forapp.com/api/getContacts.php?data=[ {"name":"abc","phone":"1234567890"},{"name":"Kate Bell","phone":"9925992599"} ] so how i can pass this type of request to the api AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager]; NSDictionary

AFNetworking 2.0 Reachability not working

流过昼夜 提交于 2020-02-01 05:07:18
问题 I'm having some trouble making AFNetworking Reachability module to work. I have setup my AFHTTPRequestOperationManager with a ReachabilityStatusChangeBlock but it's never being called. self.manager = [[AFHTTPRequestOperationManager alloc] initWithBaseURL:[NSURL URLWithString:@"http://192.168.1.2:3000"]]; self.manager.responseSerializer = [AFJSONResponseSerializer serializer]; NSOperationQueue *operationQueue = self.manager.operationQueue; [self.manager.reachabilityManager

Url Encoding of dictionary with AFNetworking in Objective-c

南笙酒味 提交于 2020-01-16 18:19:32
问题 i have to send POST request in following format to the server: Content Type: application/x-www-form-urlencoded Form Key : data Form Value : [ { "email" : "test@test.com", "password" : "test@test.com" } ] When i send request by this format in web rest client (Postman/Advance Rest Client),i got success in response. So how can i send this type of response with AFNetworking ? My code for Objective-c is NSDictionary *dictLogin = @{@"email":@"test@test.com",@"password":@"test@test.com"};

Having problems using AFNetworking fetching JSON

浪子不回头ぞ 提交于 2020-01-16 01:56:18
问题 So i recently wanted to change from using NSUrlConnection to AFNetworking. I can receive the JSON data with both methods buts when using with AFNetworking something weird happens. This is how it looks like with NSURLConnection and this is how it looks like with AFNetworking I have no idea what that (struct __lidb_autoregen_nspair) is and i dont know if that is the thing that is preventing me from displaying the data This is the code from AFNetworking, i use the sample code from ray -(void)

Having problems using AFNetworking fetching JSON

痞子三分冷 提交于 2020-01-16 01:56:08
问题 So i recently wanted to change from using NSUrlConnection to AFNetworking. I can receive the JSON data with both methods buts when using with AFNetworking something weird happens. This is how it looks like with NSURLConnection and this is how it looks like with AFNetworking I have no idea what that (struct __lidb_autoregen_nspair) is and i dont know if that is the thing that is preventing me from displaying the data This is the code from AFNetworking, i use the sample code from ray -(void)

How to sent data in variable via POST and AFNetworking?

强颜欢笑 提交于 2020-01-15 03:26:15
问题 I use this method: NSDictionary *params = @{@"email" : email, @"password" : pass }; NSString* HOST_URL = @"http://server.com:8080"; AFHTTPClient *httpClient = [[AFHTTPClient alloc] initWithBaseURL:[NSURL URLWithString:HOST_URL]]; NSMutableURLRequest *request = [httpClient requestWithMethod:@"POST" path:@"/login" parameters:params]; AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request]; [httpClient registerHTTPOperationClass:[AFHTTPRequestOperation class]

AFNetworking 2.0 Plist

两盒软妹~` 提交于 2020-01-14 06:59:31
问题 I want to update my App with the latest AFNetworking version 2. Since now they have changed some things I was wondering how to download plist files. I found this example in the documentation: NSURL *URL = [NSURL URLWithString:@"http://example.com/foo.json"]; NSURLRequest *request = [NSURLRequest requestWithURL:URL]; AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request]; operation.responseSerializer = [AFJSONSerializer serializer]; [operation