I need to extract some data from a http header. Prior to being sent by the server, the data has been base64 encoded and then URL encoded. The header looks like:
<snip>
Server = Apache;
"Transfer-Encoding" = Identity;
"Www-Authenticate" = "Basic realm=\"itYNcEpMfSPfewXAOte3II6xXsM6aNBO197bBuvb9gvWVl7Xo%2FQJ9j9r0hHz0k12xLRqlyvczoCM7kI9q1opHj%2BKYiPz73DqypNFgYGleR3n0bcVTto80Hq55i6nsgPaCnHrWJOdQs1HY%2FzzuK6vbZYAIofiB7VKSwdi00ZmkbQi9Pi05i4lCaCu%2FwV%2FXOOS95oL8TQ%3D\"";
In order to remove the URL encoding and base64 encoding, should I extract the raw header data as an NSString or as NSData?
NSString* option1 = [header objectForKey: @"Www-Authenticate"];
NSData* option2 = [header objectForKey: @"Www-Authenticate"];
Is it important to choose one over the other, or could both options be used equally?
(Note I'm not asking how to decode from URL encoding and decode from Base64, I'm asking if the starting point should be as NSString or NSData and why, or it doesn't matter).