-3

I'm trying to make a request to a server and I don't know why it doesn't work. Here's my current code:

NSURL *url = [NSURL URLWithString:@"http://www.www.www/www"];
    AFHTTPClient *httpclient = [[AFHTTPClient alloc] initWithBaseURL:url];
    [httpclient defaultValueForHeader:@"Accept"];

    NSDictionary *params = [NSDictionary dictionaryWithObjectsAndKeys:valor, parametre, nil];


    NSMutableURLRequest *request = [httpclient requestWithMethod:@"PUT"
                                                            path:@"http://www.www.www/www"
                                                      parameters:params];
    //AFNetworking
    AFHTTPRequestOperation *afnet = [[AFHTTPRequestOperation alloc] initWithRequest:request];
    [afnet start];

    NSLog(@"%@: %@",[afnet responseString], [[afnet error] localizedDescription]);
iosdevrocks
  • 985
  • 3
  • 9
  • 17

1 Answers1

1

It is not working becoz the path is not valid, path is the extra part of your base url which changes .Your are putting full URL in place of path.

amar
  • 4,147
  • 6
  • 35
  • 48