Note that there are some explanatory texts on larger screens.

plurals
  1. POPost data with a request in a Windows Store app WebView - using C#
    primarykey
    data
    text
    <p>I have the following scenario in my app:</p> <p>At first startup, the user can register an account. The app then gets a pair (int user_id, string session_id) from my webserver and stores that data in-app.</p> <p>In my app I use a WebView which lets the user look at some content of my site. Using the user_id and the session_id, he gets logged in automatically (after that, server side session and cookies are created). </p> <p>I did not want to use an url scheme like <a href="http://mobile.mysite.com/?user_id=int&amp;session_id=string" rel="nofollow">http://mobile.mysite.com/?user_id=int&amp;session_id=string</a>, so I decided to use http post to send the user_id and session_id.</p> <p>In iOS it was very easy:</p> <pre><code>// Post the user data and load the website in the webview NSString *startUrl = @"http://mobile.mysite.com/"; NSString *post = [NSString stringWithFormat:@"user_id=%@&amp;session_id=%@, [user uid], [user sessionId]]; NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:startUrl]]; [request setHTTPMethod:@"POST"]; [request setHTTPBody:[post dataUsingEncoding: NSUTF8StringEncoding]]; [webView loadRequest:request]; </code></pre> <p>So here I am, having done the same structure in my Windows 8 Store app in C#. Unfortunately, WebView does not let me post the user info to the server.</p> <p>Do you have an idea how I could solve my problem?</p> <p>One idea would be to make a http request and share the cookie with the WebView. But that does not look very elegant to me...</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload