I have a REST service running on a local apache server. I am trying to send a http request to trigger it from an ios application. I have tried in numerous ways but the request doesn't seem to reach the server.
EDIT: The REST service decides what to call based on a specific MIME type, that's why I'm setting the content-type.
This is what I have at the moment for code:
- (IBAction)fetchTweet
{
NSURL *url = [NSURL URLWithString:@"http://127.0.0.1:8080/Jersey/rest/hello"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[request addValue:@"text/html; charset=UTF-8" forHTTPHeaderField:@"Content-Type"];
NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
self.connection = connection;
[connection start];
}
- (IBAction)go:(id)sender
{
[self fetchTweet];
self.label.text = @"Working";
}