ios - Launching web url with Session -
i developing html web page. creating session id in that.
i want use same session id opening web site through ios app well.
nsstring *urlstring = @"http://www.myserver.com:8080/test/testpage"; nsurl *url = [nsurl urlwithstring:urlstring]; nsurlrequest *urlrequest = [nsurlrequest requestwithurl:url]; [webview loadrequest:urlrequest];
is possible launch web url using session id appended in ios?
if not understanding in wrong way, want add parameters request, in case sessionid. in case should this:
nsurl *url = [nsurl urlwithstring: @"http://www.myserver.com:8080/test/testpage"]; nsstring *body = [nsstring stringwithformat: @"sessionid=%@", @"val1"]; nsmutableurlrequest *request = [[nsmutableurlrequest alloc]initwithurl: url]; [request sethttpmethod: @"post"]; [request sethttpbody: [body datausingencoding: nsutf8stringencoding]]; [webview loadrequest: request];
on other way around, can use example afnetworking library allow things this:
nsdictionary * parameters = @{@"sessionid" : @"123"}; nsmutableurlrequest * mutablerequest = [self requestwithmethod:@"post" path:@"http://www.myserver.com:8080/test/testpage" parameters:parameters];
anyways, @popeye right, need manage somehow in server.
Comments
Post a Comment