title: Android WebView Protocol Handler
body: <p>I am trying to develop an Android browser application using <a href="http://developer.android.com/reference/android/webkit/WebView.html" rel="nofollow noreferrer">WebView</a> which enables users to access content from a custom protocol. The custom protocol could be <em>foobar://</em></p>
  
  <p>I want to intercept all requests to this custom protocol. This means:</p>
  
  <ol>
  <li>GET requests</li>
  <li>POST requests</li>
  </ol>
  
  <p>and I need to be able to hand the results of these operations back to the WebView.</p>
  
  <p>The GET requests can be handled using <a href="http://developer.android.com/reference/android/webkit/WebViewClient.html#shouldInterceptRequest%28android.webkit.WebView,%20java.lang.String%29" rel="nofollow noreferrer">shouldInterceptRequest</a> (available from API level 11).</p>
  
  <p>Now my problem is: <strong>How can I incercept and handle POST requests</strong>?</p>
  
  <p>Nearly the same question has been asked <a href="https://stackoverflow.com/questions/7584597/how-to-intercept-post-data-in-an-android-webview">here</a> and <a href="https://stackoverflow.com/questions/3664440/android-how-to-intercept-a-form-post-in-android-webviewclient-on-api-level-4">here</a>, however no solutions for their problems have been found.</p>