Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8686739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:56:23+00:00 2026-06-12T22:56:23+00:00

I am developing a very simple application which accesses a written url. So i

  • 0

I am developing a very simple application which accesses a written url. So i am wondering what is the difference between access by nsurlconnection and access by just using browser. cause some sites respond but they don`t send data when i used the nsurlconnection.

- (void)getWikiData:(NSString *)keyword{
NSString* tmpURL = @"http://wikipedia.simpleapi.net/api?keyword=";
NSString* encodedString;
CFStringRef strRef = CFURLCreateStringByAddingPercentEscapes(NULL, (CFStringRef)keyword, NULL, (CFStringRef)@"!*'();:@&=+$,/?%#[]~", kCFStringEncodingUTF8);
encodedString = [NSString stringWithString:(NSString *)strRef];
CFRelease(strRef);
[tmpURL stringByAppendingString:encodedString];
[tmpURL stringByAppendingString:@"&output=html"];
NSURL *url = [NSURL URLWithString:tmpURL];

NSString *userAgent = @"Custom User Agent";
NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] initWithURL:url] autorelease];
[request setValue:userAgent forHTTPHeaderField:@"User-Agent"];

connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
}

- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSHTTPURLResponse *)response{
NSLog(@"Receive Response");

}

- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data{
NSLog(@"Receive Data");
}

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T22:56:24+00:00Added an answer on June 12, 2026 at 10:56 pm

    The difference is in the user agent string of the resulting application. MobileSafari reports itself as “Safari, iOS like Mac OS X”, however, a plain NSURLConnection sends a CFNetwork description, which is not very useful for most sites to do ‘browser’ (rather ‘client’) detection, that’s why they may refuse to send data to an unrecognized user agent.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing a very simple web application in python using the bottle microframework
I am currently developing a very simple script in AutoHotKey, but it involves using
I'm developing a control which inherits from a System.Windows.Form.Panel. The idea is very simple:
Im Developing a web application which is very critical. So authentication has to be
I am very very new to xml. I am developing an application which uses
I'm developing a very simple cross platform window class in C++ just so I
I'm developing a simple application which is supposed to simply copy another existing executable
I have lately been developing a very simple app for iOS with PhoneGap. All
I'm developing a desktop Mac OS X App that saves its very simple data
I am very new to android and I am developing this app which allows

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.