Chetan Gharat
Chetan Gharat

Reputation: 85

how to pass an string value in url in iPhone app?

I have this URL I want to pass Self.Id in this url cid=self.Id .I am pass following why but getting result invalid request.

    NSURL *url = [NSURL URLWithString: 
    @"http://sms.instatalkcommunications.com/apireq/GetCommentsForSMS?
     t=1&h=admin&last=0&cid=Self.Id&items=5"];
    ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
   [request setRequestMethod:@"GET"];
   [request setDidFailSelector:@selector(requestCompleted:)];
   [request setDelegate:self];
   [request startAsynchronous];

Upvotes: 0

Views: 203

Answers (1)

Balu
Balu

Reputation: 8460

[NSURL URLWithString:[NSString stringWithFormat:@"http://sms.instatalkcommunications.com/apireq/GetCommentsForSMS?
     t=1&h=admin&last=0&cid=%@&items=5",Self.Id]];

Upvotes: 3

Related Questions