iPhone how to take data from xml over the network
I have two questions.
- I have my data in XML format on web server. How can i connect it and use that data.
- Is this secure? Can i use it in professional application开发者_运维问答?
Thanks for any sort of advice in advance.
To get xml file from url:
NSMutableString *serverURL = *xml url here*;
NSMutableURLRequest *request =[NSMutableURLRequest requestWithURL:[NSURL URLWithString:serverURL]];
[request setHTTPMethod:@"GET"];
NSData *responsedata = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];
Is it secure? It depends on how secure you need. If you're just transferring generic data, it doesn't really need to be secure. If you're transferring sensitive or personal data, then you need to (at minimum) use a secure SSL connection and some sort of authentication scheme.
精彩评论