Identifying an app from a URL request
If a URL request is made from an iPhone app, is it possible for the service to which the request is made to identify the app? Generally, a service can see the IP address from which the request is made, but is more identifying information included in t开发者_如何转开发he request? My aim is to ensure that the app cannot be identified.
Log the simulator network traffic to a file:
sudo tcpdump -s 0 -A -i en0 port 80 > log.txt
Then read the file and see if your app behaves any different from a browser. Note that your network interface may vary. Run ifconfig -a
to see if you are on en0, en1, or what.
You can change the user agent and any other header if you need to...
If you are using ASIHTTPRequest:
[ASIHTTPRequest setDefaultUserAgentString:@"firefox blah blah"];
If you are using NSMutableURLRequest:
[request setValue:@"firefox blah" forHTTPHeaderField:@"User-Agent"];
You could pass a parameter from the app to the service. http://..url?param1=..&app=myApp
精彩评论