| 1 |
package com.pywebview; |
| 2 |
|
| 3 |
/** |
| 4 |
* Interface for intercepting WebView requests and responses. |
| 5 |
*/ |
| 6 |
public interface WebViewRequestInterceptor { |
| 7 |
/** |
| 8 |
* Called when a web request is made. |
| 9 |
* |
| 10 |
* @param url The URL of the request |
| 11 |
* @param method The HTTP method (GET, POST, etc.) |
| 12 |
* @param headersJson JSON string representation of the request headers |
| 13 |
*/ |
| 14 |
String onRequest(String url, String method, String headersJson); |
| 15 |
|
| 16 |
/** |
| 17 |
* Called when a response is received. |
| 18 |
* |
| 19 |
* @param url The URL of the request |
| 20 |
* @param statusCode The HTTP status code |
| 21 |
* @param headersJson JSON string representation of the response headers |
| 22 |
*/ |
| 23 |
void onResponse(String url, int statusCode, String headersJson); |
| 24 |
} |