sixones / vitality

Macintosh Eve online skill planner
GNU General Public License v3.0
70 stars 12 forks source link

Set User-Agent header for all API calls #37

Closed Bleyddyn closed 9 years ago

Bleyddyn commented 9 years ago

CCP requests that all API calls have a User-Agent set in case they need to contact a developer about issues. See https://developers.testeveonline.com/resource/xml-api

Code like this can be used to do that: NSString* userAgent = @"My Cool User Agent"; NSURL* url = [NSURL URLWithString:@"http://whatsmyuseragent.com/"]; NSMutableURLRequest* request = [[[NSMutableURLRequest alloc] initWithURL:url] autorelease]; [request addValue:userAgent forHTTPHeaderField:@"User-Agent"];

Our User-Agent could be something like: @"Vitality v0.3 (https://github.com/sixones/vitality)"

Bleyddyn commented 9 years ago

The code is done and in the 0.3.1b release (https://github.com/sixones/vitality/releases/tag/v0.3.1b). I tested the server monitor call by replacing the URL with my own web server, but I'm not sure how to test anything else. With all of the other CCP calls going through https, I don't think I'll be able to see headers with wireshark or similar tools.

BJClark commented 9 years ago

You can probably test this with Charles Proxy. http://www.charlesproxy.com