I implemented the following code:
NSURL *url = [ NSURL URLWithString:[ NSString stringWithFormat: @'http://www.google.com/search?q=%@', query ] ]; NSURLRequest *request = [ NSURLRequest requestWithURL: url ];
I want to extract the body from what I receive back from the url above. I attempted:
NSData *data = [request HTTPBody];
The data variable doesn’t return any data? Am I going about extracting the data out of the request the right way?
Thanks!
If you’re just trying to get a web page, you can use this.
If you really want to convert the data from NSData you can use this: