We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
有时候使用webview需要查看发送的header信息是否正确发送,一般我们都是和后台配合来检验的。其实我们也可以自己来检验,自己启动一个node作为服务端,然后连接本地的node服务来查看header信息。
var http = require('http'); var port = 9000; function logRequest(request) { console.log("request headers: ", request.headers) console.log("Processing request for: ", request.url) console.log('Time',new Date().toString()) } http.createServer(function(request, response) { response.writeHead(200, {"Content-Type": "text/html"}); switch(request.url) { case "/": response.write("<html><body>Welcome<a href='/bye'>Bye</a></body></html>"); logRequest(request) break; case "/bye": response.write("<html><body>Bye<a href='/'>Welcome</a></body></html>"); logRequest(request) break; default: break; } response.end(); }).listen(port);
1:新建js文件取名server.js 然后复制上面的代码 2:打开命令行 node ../../server.js(server.js 路径) 3:修改webview 的source路径 添加header信息
source={{uri: "http://localhost:9000/", headers: {name:"wuyunqiang",do:"testing"}}}
4:正常运行应用 打开webview页面 命令行显示如下
The text was updated successfully, but these errors were encountered:
No branches or pull requests
有时候使用webview需要查看发送的header信息是否正确发送,一般我们都是和后台配合来检验的。其实我们也可以自己来检验,自己启动一个node作为服务端,然后连接本地的node服务来查看header信息。
1:新建js文件取名server.js 然后复制上面的代码
2:打开命令行 node ../../server.js(server.js 路径)
3:修改webview 的source路径 添加header信息
4:正常运行应用 打开webview页面 命令行显示如下
![7C5797FE-CC3E-402F-971F-632DB13C067B.png](https://camo.githubusercontent.com/496302ab624f54871ef1583af6262e6d719b44f07c89d2d7c4e87299a4d619e3/68747470733a2f2f75706c6f61642d696d616765732e6a69616e7368752e696f2f75706c6f61645f696d616765732f333335333735352d653739646137373861336465346463352e706e673f696d6167654d6f6772322f6175746f2d6f7269656e742f7374726970253743696d61676556696577322f322f772f383030)
The text was updated successfully, but these errors were encountered: