将日志中的json请求提取,并且发送到另外一个机器上: for i in ` cat impression.log.2016-04-08-10 |awk -F"\t" ' {print $6}' ` ; do curl "http://localhost:9888$i" ; done 使用cat 文件,read line 的形式实现 遍历行循环发送: #!/bin/bash cat data.txt | while read line do # echo $line
一.Httpclient发送json请求 public String RequestJsonPost(String url){ String strresponse = null; try{ HttpClient hc = new DefaultHttpClient(); HttpPost hp = new HttpPost(url); JSONObject jsonParam = new JSONObject(); jsonPara
这样几行简单的代码创建一个web服务器: var express = require('express'); var app = express(); var server = require('http').Server(app); var bodyParser = require('body-parser'); app.use(bodyParser.json({limit: '10mb', extended: true})); 然后使用app.post("/getSimilarImage&q