Korzystanie z AFNetworking i podstawowego uwierzytelniania HTTP

Poniższy kod pomyślnie łączy się z moim interfejsem API Ruby on Rails i zwraca JSON przy użyciu AFNetworking. Co muszę zrobić, aby to edytować, aby przekazać nazwę użytkownika i hasło, aby mój interfejs API mógł korzystać z podstawowego uwierzytelniania HTTP?

Przeczytałem ich dokumentację, ale jestem nowy zarówno w Objective-C, jak i AFNetworking i obecnie nie ma to sensu.

NSURL *url = [[NSURL alloc] initWithString:@"http://localhost:3000/tasks.json"];

NSURLRequest *request = [[NSURLRequest alloc] initWithURL:url];

AFJSONRequestOperation *operation = [AFJSONRequestOperation
                                     JSONRequestOperationWithRequest:request
                                     success:^(NSURLRequest *request
                                     , NSHTTPURLResponse *response
                                     , id JSON) {

    self.tasks = [JSON objectForKey:@"results"];
    [self.activityIndicatorView stopAnimating];
    [self.tableView setHidden:NO];
    [self.tableView reloadData];

    NSLog(@"JSON");

} failure:^(NSURLRequest *request
                , NSHTTPURLResponse *response
                , NSError *error
                , id JSON) {
    NSLog(@"Request Failed with Error: %@, %@", error, error.userInfo);
}];

[operation start];

questionAnswers(1)

yourAnswerToTheQuestion