views:

588

answers:

2

Sorry, I would just test this myself, but I'm currently without my mac. Does a web request made inside of a UIWebView send the same user-agent info that a web request made from mobile Safari would?

+1  A: 

Yes. Yes it does.

However, you can override it. If you create a NSMutableURLRequest to seed the web view with you can set all your own headers. Check out the method:

- (void)setValue:(NSString *)value forHTTPHeaderField:(NSString *)field
Squeegy
I appreciate the tip on how to set the user-agent. I'm not sure it's correct that UIWebView has the same user-agent as Safari though. In some limited tests I've done since posting this, Safari seems to differentiate itself by including "Safari" in the user-agent string, where UIWebView does not.
dl
dl - did you find the answer to this? I have the same problem.
amok
A: 

I found that a UIWebView was sending this

<AppName>/1.0 CFNetwork/459 Darwin/10.2.0

but that was while using the simulator, I have not tried on a device yet.

Robot Woods