| | |
| | | } |
| | | } |
| | | |
| | | func UploadFromMat(rook gocv.Mat)(maps map[string]interface{}, err0 error){ |
| | | func UploadFromMat(url string,rook gocv.Mat)(maps map[string]interface{}, err0 error){ |
| | | // 上传 |
| | | fdata, _ := gocv.IMEncode(".jpg", rook) |
| | | body := &bytes.Buffer{} |
| | |
| | | request_reader := io.MultiReader(body, file, close_buf) |
| | | //_, err = io.Copy(part, file) |
| | | //writer.WriteField(key, val) |
| | | request, err := http.NewRequest("POST", "http://192.168.1.182:6333/submit", request_reader) |
| | | request, err := http.NewRequest("POST", url, request_reader) |
| | | request.Header.Add("Content-Type", writer.FormDataContentType()) |
| | | timeout := time.Duration(5 * time.Second) //超时时间50ms |
| | | client := &http.Client{Timeout: timeout} |