I used postman and give me that code and i try.
NSDictionary *headers = @{ @"authorization": @"Basic dXNlcl90c19hcGk6cW****************",
@"cache-control": @"no-cache",
@"postman-token": @"48ca81bb-eea4-7196-*******************" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://www.techshort.in/ts_api/category_list.php"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
But it doesn't work for me. So how i can use in AFNetworking.
